Rocket/core/codegen/tests/ui-fail-stable/route-attribute-general-syn...

207 lines
6.4 KiB
Plaintext
Raw Normal View History

error: missing expected parameter: `path`
--> $DIR/route-attribute-general-syntax.rs:5:1
|
5 | #[get()] //~ ERROR missing expected parameter
| ^^^^^^^^
2020-02-15 11:51:40 +00:00
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:11:1
|
11 | struct S;
| ^^^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:16:1
|
16 | enum A { }
| ^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:21:1
|
21 | trait Foo { }
| ^^^^^
error: expected `fn`
--- help: #[get] can only be used on functions
--> $DIR/route-attribute-general-syntax.rs:26:1
|
26 | impl S { }
| ^^^^
error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:32:12
|
32 | #[get("/", 123)] //~ ERROR expected
| ^^^
error: expected key/value pair
--> $DIR/route-attribute-general-syntax.rs:35:12
|
35 | #[get("/", "/")] //~ ERROR expected
| ^^^
error: unexpected keyed parameter: expected literal or identifier
--> $DIR/route-attribute-general-syntax.rs:38:7
|
38 | #[get(data = "<foo>", "/")] //~ ERROR unexpected keyed parameter
| ^^^^
error: unexpected attribute parameter: `unknown`
--> $DIR/route-attribute-general-syntax.rs:41:12
|
41 | #[get("/", unknown = "foo")] //~ ERROR unexpected
| ^^^^^^^
error: malformed attribute
--- help: expected syntax: #[get(key = value, ..)]
--> $DIR/route-attribute-general-syntax.rs:44:1
|
44 | #[get("/", ...)] //~ ERROR malformed
| ^^^^^^^^^^^^^^^^
|
2020-02-15 11:51:40 +00:00
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: handler arguments cannot be ignored
--- help: all handler arguments must be of the form: `ident: Type`
--> $DIR/route-attribute-general-syntax.rs:51:7
|
51 | fn c1(_: usize) {} //~ ERROR cannot be ignored
| ^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:56:7
|
56 | #[get(100)] //~ ERROR expected string
| ^^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:59:7
|
59 | #[get('/')] //~ ERROR expected string
| ^^^
error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:62:19
|
62 | #[get("/", rank = "1")] //~ ERROR expected integer
| ^^^
error: invalid value: expected integer literal
--> $DIR/route-attribute-general-syntax.rs:65:19
|
65 | #[get("/", rank = '1')] //~ ERROR expected integer
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:70:21
|
70 | #[get("/", format = "applicationx-custom")] //~ ERROR invalid or unknown media type
| ^^^^^^^^^^^^^^^^^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:73:21
|
73 | #[get("/", format = "")] //~ ERROR invalid or unknown media type
| ^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:76:21
|
76 | #[get("/", format = "//")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:79:21
|
79 | #[get("/", format = "/")] //~ ERROR invalid or unknown media type
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:82:21
|
82 | #[get("/", format = "a/")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:85:21
|
85 | #[get("/", format = "/a")] //~ ERROR invalid or unknown media type
| ^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:88:21
|
88 | #[get("/", format = "/a/")] //~ ERROR invalid or unknown media type
| ^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:91:21
|
91 | #[get("/", format = "a/b/")] //~ ERROR invalid or unknown media type
| ^^^^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:94:21
|
94 | #[get("/", format = "unknown")] //~ ERROR unknown media type
| ^^^^^^^^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:97:21
|
97 | #[get("/", format = 12)] //~ ERROR expected string
| ^^
error: invalid value: expected string literal
--> $DIR/route-attribute-general-syntax.rs:100:21
|
100 | #[get("/", format = 'j')] //~ ERROR expected string
| ^^^
error: invalid or unknown media type
--> $DIR/route-attribute-general-syntax.rs:103:21
|
103 | #[get("/", format = "text//foo")] //~ ERROR invalid or unknown media type
| ^^^^^^^^^^^
error: invalid HTTP method for route handlers
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:108:9
|
108 | #[route(CONNECT, "/")] //~ ERROR invalid HTTP method for route
| ^^^^^^^
error: invalid HTTP method
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:112:9
|
112 | #[route(FIX, "/")] //~ ERROR invalid HTTP method
| ^^^
error: expected identifier, found string literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:116:9
|
116 | #[route("hi", "/")] //~ ERROR expected identifier
| ^^^^
error: expected identifier, found string literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:120:9
|
120 | #[route("GET", "/")] //~ ERROR expected identifier
| ^^^^^
error: expected identifier, found integer literal
--- help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS`
--> $DIR/route-attribute-general-syntax.rs:124:9
|
124 | #[route(120, "/")] //~ ERROR expected identifier
| ^^^