1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#[macro_use] extern crate rocket;
use rocket::Request;
#[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) { }
#[catch(code = "404")] //~ ERROR unexpected keyed parameter
//~^ HELP #[catch(404)]
fn e2(_request: &Request) { }
#[catch(code = 404)] //~ ERROR unexpected keyed parameter
//~^ 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
}
fn main() { }