2018-10-05 04:44:42 +00:00
|
|
|
// must-compile-successfully
|
|
|
|
|
|
|
|
#[macro_use] extern crate rocket;
|
|
|
|
|
|
|
|
// Check for unknown media types.
|
|
|
|
|
2020-07-21 17:23:59 +00:00
|
|
|
#[get("/", format = "application/x-custom")]
|
2018-10-05 04:44:42 +00:00
|
|
|
fn f0() {}
|
|
|
|
|
2020-07-21 17:23:59 +00:00
|
|
|
#[get("/", format = "x-custom/plain")]
|
2018-10-05 04:44:42 +00:00
|
|
|
fn f1() {}
|
|
|
|
|
2020-07-21 17:23:59 +00:00
|
|
|
#[get("/", format = "x-custom/x-custom")]
|
2018-10-05 04:44:42 +00:00
|
|
|
fn f2() {}
|
|
|
|
|
|
|
|
// Check if a data argument is used with a usually non-payload bearing method.
|
|
|
|
|
2020-07-21 17:23:59 +00:00
|
|
|
#[get("/", data = "<_foo>")]
|
2021-06-08 09:13:02 +00:00
|
|
|
fn g0(_foo: rocket::Data<'_>) {}
|
2018-10-05 04:44:42 +00:00
|
|
|
|
2020-07-21 17:23:59 +00:00
|
|
|
#[head("/", data = "<_foo>")]
|
2021-06-08 09:13:02 +00:00
|
|
|
fn g1(_foo: rocket::Data<'_>) {}
|
2018-10-05 04:44:42 +00:00
|
|
|
|
2020-07-20 22:02:10 +00:00
|
|
|
fn main() {
|
|
|
|
compile_error!("checking for warnings!")
|
|
|
|
}
|