2018-09-17 03:52:07 +00:00
|
|
|
#[macro_use] extern crate rocket;
|
2018-09-16 07:33:16 +00:00
|
|
|
|
2018-09-17 03:52:07 +00:00
|
|
|
use rocket::Request;
|
2018-09-16 07:33:16 +00:00
|
|
|
|
|
|
|
#[catch(404)]
|
|
|
|
struct Catcher(String);
|
|
|
|
//~^ ERROR expected `fn`
|
|
|
|
//~^^ HELP on functions
|
|
|
|
|
|
|
|
#[catch(404)]
|
|
|
|
const CATCH: &str = "Catcher";
|
|
|
|
//~^ ERROR expected `fn`
|
|
|
|
//~^^ HELP on functions
|
|
|
|
|
|
|
|
#[catch("404")] //~ ERROR expected unsigned integer literal
|
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e1(_request: &Request) { }
|
|
|
|
|
2018-10-04 10:54:46 +00:00
|
|
|
#[catch(code = "404")] //~ ERROR unexpected keyed parameter
|
2018-09-16 07:33:16 +00:00
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e2(_request: &Request) { }
|
|
|
|
|
2018-10-04 10:54:46 +00:00
|
|
|
#[catch(code = 404)] //~ ERROR unexpected keyed parameter
|
2018-09-16 07:33:16 +00:00
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e3(_request: &Request) { }
|
|
|
|
|
|
|
|
#[catch(99)] //~ ERROR in range [100, 599]
|
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e4(_request: &Request) { }
|
|
|
|
|
|
|
|
#[catch(600)] //~ ERROR in range [100, 599]
|
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e5(_request: &Request) { }
|
|
|
|
|
|
|
|
#[catch(400, message = "foo")] //~ ERROR unexpected attribute parameter: `message`
|
|
|
|
//~^ HELP #[catch(404)]
|
|
|
|
fn e5(_request: &Request) { }
|
|
|
|
|
|
|
|
#[catch(404)]
|
|
|
|
fn f3(_request: &Request, other: bool) {
|
|
|
|
//~^ ERROR invalid number of arguments
|
|
|
|
//~^^ HELP optionally take an argument
|
|
|
|
}
|
2018-12-29 17:31:14 +00:00
|
|
|
|
|
|
|
fn main() { }
|