Rocket/core/codegen/tests/ui-fail/route-warnings.rs

35 lines
703 B
Rust
Raw Normal View History

// must-compile-successfully
#[macro_use] extern crate rocket;
// Check for unknown media types.
#[get("/", format = "application/x-custom")]
fn f0() {}
#[get("/", format = "x-custom/plain")]
fn f1() {}
#[get("/", format = "x-custom/x-custom")]
fn f2() {}
#[suppress(unknown_format)]
#[get("/", format = "x-custom/x-custom")]
fn f3() {}
// Check if a data argument is used with a usually non-payload bearing method.
#[get("/", data = "<_foo>")]
fn g0(_foo: rocket::Data<'_>) {}
#[head("/", data = "<_foo>")]
fn g1(_foo: rocket::Data<'_>) {}
#[suppress(dubious_payload)]
#[head("/", data = "<_foo>")]
fn g2(_foo: rocket::Data<'_>) {}
fn main() {
compile_error!("checking for warnings!")
}