Update 'Try' impl, codegen for nightly-2021-05-18.

Minimum nightly is now '2021-05-18'.
This commit is contained in:
Sergio Benitez 2021-05-18 20:57:41 -07:00
parent f939439911
commit 425f741b87
16 changed files with 120 additions and 105 deletions

View File

@ -4,7 +4,7 @@ error: expected string literal
6 | #[database]
| ^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected string literal
--> $DIR/database-syntax.rs:10:12

View File

@ -116,8 +116,8 @@ fn add_binding(to: &mut Vec<TokenStream2>, ident: &Ident, ty: &Type, expr: &Expr
};
to.push(quote_spanned!(span =>
let #ident_tmp = #expr;
let #ident = <#ty as #from_uri_param>::from_uri_param(#ident_tmp);
#[allow(non_snake_case)] let #ident_tmp = #expr;
#[allow(non_snake_case)] let #ident = <#ty as #from_uri_param>::from_uri_param(#ident_tmp);
));
}

View File

@ -277,7 +277,7 @@ fn check_complex() {
#[test]
fn check_location_promotion() {
struct S1(String);
struct S2 { name: String };
struct S2 { name: String }
let s1 = S1("Bob".into());
let s2 = S2 { name: "Bob".into() };

View File

@ -16,4 +16,4 @@ error: unexpected end of input, expected identifier
9 | let _ = catchers![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `catchers` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -9,7 +9,7 @@ note: error occurred while deriving `FromForm`
|
5 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form.rs:10:1
@ -22,7 +22,7 @@ note: error occurred while deriving `FromForm`
|
9 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: at least one field is required
--> $DIR/from_form.rs:14:1
@ -35,7 +35,7 @@ note: error occurred while deriving `FromForm`
|
13 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form.rs:18:1
@ -48,7 +48,7 @@ note: error occurred while deriving `FromForm`
|
17 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: only one lifetime is supported
--> $DIR/from_form.rs:22:20
@ -61,7 +61,7 @@ note: error occurred while deriving `FromForm`
|
21 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:32:20
@ -74,7 +74,7 @@ note: error occurred while deriving `FromForm`
|
30 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:41:5
@ -92,7 +92,7 @@ note: error occurred while deriving `FromForm`
|
37 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:49:20
@ -110,7 +110,7 @@ note: error occurred while deriving `FromForm`
|
45 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate field name
--> $DIR/from_form.rs:57:20
@ -128,7 +128,7 @@ note: error occurred while deriving `FromForm`
|
54 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate attribute parameter: field
--> $DIR/from_form.rs:64:28
@ -141,7 +141,7 @@ note: error occurred while deriving `FromForm`
|
62 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: malformed attribute: expected list
--> $DIR/from_form.rs:71:7
@ -155,7 +155,7 @@ note: error occurred while deriving `FromForm`
|
69 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected key/value pair
--> $DIR/from_form.rs:78:12
@ -168,7 +168,7 @@ note: error occurred while deriving `FromForm`
|
76 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected key/value pair
--> $DIR/from_form.rs:85:12
@ -181,7 +181,7 @@ note: error occurred while deriving `FromForm`
|
83 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected attribute parameter: `beep`
--> $DIR/from_form.rs:92:12
@ -194,7 +194,7 @@ note: error occurred while deriving `FromForm`
|
90 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: duplicate invocation of `form` attribute
--> $DIR/from_form.rs:100:5
@ -207,7 +207,7 @@ note: error occurred while deriving `FromForm`
|
97 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form.rs:107:20
@ -220,7 +220,7 @@ note: error occurred while deriving `FromForm`
|
105 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected literal or key/value pair
--> $DIR/from_form.rs:114:12
@ -233,7 +233,7 @@ note: error occurred while deriving `FromForm`
|
112 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form.rs:121:20
@ -246,7 +246,7 @@ note: error occurred while deriving `FromForm`
|
119 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:128:20
@ -259,7 +259,7 @@ note: error occurred while deriving `FromForm`
|
126 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:135:20
@ -272,7 +272,7 @@ note: error occurred while deriving `FromForm`
|
133 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:142:20
@ -285,7 +285,7 @@ note: error occurred while deriving `FromForm`
|
140 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:149:20
@ -298,7 +298,7 @@ note: error occurred while deriving `FromForm`
|
147 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:156:20
@ -311,7 +311,7 @@ note: error occurred while deriving `FromForm`
|
154 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid form field name
--> $DIR/from_form.rs:163:20
@ -324,4 +324,4 @@ note: error occurred while deriving `FromForm`
|
161 | #[derive(FromForm)]
| ^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -9,7 +9,7 @@ note: error occurred while deriving `FromFormValue`
|
3 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs are not supported
--> $DIR/from_form_value.rs:8:1
@ -22,7 +22,7 @@ note: error occurred while deriving `FromFormValue`
|
7 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> $DIR/from_form_value.rs:12:1
@ -38,7 +38,7 @@ note: error occurred while deriving `FromFormValue`
|
11 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
error: variants cannot have fields
--> $DIR/from_form_value.rs:19:5
@ -51,7 +51,7 @@ note: error occurred while deriving `FromFormValue`
|
17 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: deriving for empty enum
--> $DIR/from_form_value.rs:24:1
@ -70,7 +70,7 @@ note: error occurred while deriving `FromFormValue`
|
27 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/from_form_value.rs:35:20
@ -83,7 +83,7 @@ note: error occurred while deriving `FromFormValue`
|
33 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected literal or key/value pair
--> $DIR/from_form_value.rs:42:12
@ -96,4 +96,4 @@ note: error occurred while deriving `FromFormValue`
|
40 | #[derive(FromFormValue)]
| ^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `FromFormValue` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,7 +4,7 @@ error: missing expected parameter: `path`
7 | #[get()] //~ ERROR missing expected parameter
| ^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `fn`
--> $DIR/route-attribute-general-syntax.rs:13:1
@ -69,7 +69,7 @@ error: malformed attribute
| ^^^^^^^^^^^^^^^^
|
= help: expected syntax: #[get(key = value, ..)]
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
error: handler arguments cannot be ignored
--> $DIR/route-attribute-general-syntax.rs:53:7

View File

@ -27,7 +27,7 @@ note: 'GET' does not typically support payloads
|
20 | #[get("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method
| ^^^
= note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: `data` used with non-payload-supporting method
--> $DIR/route-warnings.rs:23:13
@ -40,7 +40,7 @@ note: 'HEAD' does not typically support payloads
|
23 | #[head("/", data = "<_foo>")] //~ WARNING used with non-payload-supporting method
| ^^^^
= note: this warning originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this warning originates in the attribute macro `head` (in Nightly builds, run with -Z macro-backtrace for more info)
error: checking for warnings!
--> $DIR/route-warnings.rs:27:5

View File

@ -16,4 +16,4 @@ error: unexpected end of input, expected identifier
9 | let _ = routes![a::]; //~ ERROR expected identifier
| ^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `routes` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -124,7 +124,7 @@ error[E0277]: the trait bound `S: Ignorable<rocket::http::uri::Query>` is not sa
| pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `assert_ignorable`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `rocket_uri_macro_other_q` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: Ignorable<rocket::http::uri::Query>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:42:16
@ -140,7 +140,7 @@ error[E0277]: the trait bound `usize: Ignorable<rocket::http::uri::Query>` is no
| pub fn assert_ignorable<P: UriPart, T: Ignorable<P>>() { }
| ------------ required by this bound in `assert_ignorable`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `rocket_uri_macro_other_q` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `S: FromUriParam<rocket::http::uri::Query, _>` is not satisfied
--> $DIR/typed-uri-bad-type.rs:83:26

View File

@ -34,7 +34,7 @@ error: unexpected end of input, expected identifier
14 | uri!("/mount",); //~ ERROR expected identifier
| ^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid mount point; mount points must be static, absolute URIs: `/example`
--> $DIR/typed-uris-invalid-syntax.rs:15:10
@ -54,7 +54,7 @@ error: unexpected end of input, call to `uri!` cannot be empty
17 | uri!(); //~ unexpected end of input
| ^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected end of input, expected expression
--> $DIR/typed-uris-invalid-syntax.rs:18:5
@ -62,4 +62,4 @@ error: unexpected end of input, expected expression
18 | uri!(simple: id = ); //~ expected expression
| ^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -9,7 +9,7 @@ note: error occurred while deriving `UriDisplay`
|
5 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:16:1
@ -22,7 +22,7 @@ note: error occurred while deriving `UriDisplay`
|
12 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: empty enums are not supported
--> $DIR/uri_display.rs:23:1
@ -35,7 +35,7 @@ note: error occurred while deriving `UriDisplay`
|
19 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: fieldless structs or variants are not supported
--> $DIR/uri_display.rs:31:5
@ -48,7 +48,7 @@ note: error occurred while deriving `UriDisplay`
|
26 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: tuple structs or variants must have exactly one field
--> $DIR/uri_display.rs:39:12
@ -61,7 +61,7 @@ note: error occurred while deriving `UriDisplay`
|
35 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid value: expected string literal
--> $DIR/uri_display.rs:47:20
@ -74,7 +74,7 @@ note: error occurred while deriving `UriDisplay`
|
42 | #[derive(UriDisplayQuery)]
| ^^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one field
--> $DIR/uri_display.rs:55:12
@ -87,7 +87,7 @@ note: error occurred while deriving `UriDisplay`
|
52 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one field
--> $DIR/uri_display.rs:61:1
@ -100,7 +100,7 @@ note: error occurred while deriving `UriDisplay`
|
58 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error: enums are not supported
--> $DIR/uri_display.rs:67:1
@ -113,7 +113,7 @@ note: error occurred while deriving `UriDisplay`
|
64 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> $DIR/uri_display.rs:73:1
@ -129,7 +129,7 @@ note: error occurred while deriving `UriDisplay`
|
70 | #[derive(UriDisplayPath)]
| ^^^^^^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
@ -142,7 +142,7 @@ error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
@ -156,7 +156,7 @@ error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo1`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:5:10
@ -170,7 +170,7 @@ error[E0277]: the trait bound `Foo1: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo1`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
@ -183,7 +183,7 @@ error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
@ -197,7 +197,7 @@ error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo2`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:12:10
@ -211,7 +211,7 @@ error[E0277]: the trait bound `Foo2: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo2`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
@ -224,7 +224,7 @@ error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
@ -238,7 +238,7 @@ error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo3`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:19:10
@ -252,7 +252,7 @@ error[E0277]: the trait bound `Foo3: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo3`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
@ -265,7 +265,7 @@ error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
@ -279,7 +279,7 @@ error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo4`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:26:10
@ -293,7 +293,7 @@ error[E0277]: the trait bound `Foo4: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo4`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
@ -306,7 +306,7 @@ error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
@ -320,7 +320,7 @@ error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo5`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:35:10
@ -334,7 +334,7 @@ error[E0277]: the trait bound `Foo5: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo5`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
@ -347,7 +347,7 @@ error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
@ -361,7 +361,7 @@ error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r Foo6`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is not satisfied
--> $DIR/uri_display.rs:42:10
@ -375,7 +375,7 @@ error[E0277]: the trait bound `Foo6: UriDisplay<rocket::http::uri::Query>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Query>` for `&'__r mut Foo6`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo7: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:52:10
@ -388,7 +388,7 @@ error[E0277]: the trait bound `Foo7: UriDisplay<rocket::http::uri::Path>` is not
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo7: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:52:10
@ -402,7 +402,7 @@ error[E0277]: the trait bound `Foo7: UriDisplay<rocket::http::uri::Path>` is not
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Path>` for `&'__r Foo7`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo8: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:58:10
@ -415,7 +415,7 @@ error[E0277]: the trait bound `Foo8: UriDisplay<rocket::http::uri::Path>` is not
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo8: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:58:10
@ -429,7 +429,7 @@ error[E0277]: the trait bound `Foo8: UriDisplay<rocket::http::uri::Path>` is not
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Path>` for `&'__r Foo8`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo9: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:64:10
@ -442,7 +442,7 @@ error[E0277]: the trait bound `Foo9: UriDisplay<rocket::http::uri::Path>` is not
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo9: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:64:10
@ -456,7 +456,7 @@ error[E0277]: the trait bound `Foo9: UriDisplay<rocket::http::uri::Path>` is not
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Path>` for `&'__r Foo9`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo10: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:70:10
@ -469,7 +469,7 @@ error[E0277]: the trait bound `Foo10: UriDisplay<rocket::http::uri::Path>` is no
| type Target: UriDisplay<P>;
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Foo10: UriDisplay<rocket::http::uri::Path>` is not satisfied
--> $DIR/uri_display.rs:70:10
@ -483,4 +483,4 @@ error[E0277]: the trait bound `Foo10: UriDisplay<rocket::http::uri::Path>` is no
| ------------- required by this bound in `rocket::http::uri::FromUriParam::Target`
|
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::Path>` for `&'__r Foo10`
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the derive macro `UriDisplayPath` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -517,7 +517,7 @@ mod tests {
#[test]
fn send_and_sync() {
fn assert<T: Send + Sync>() {};
fn assert<T: Send + Sync>() {}
assert::<Origin>();
}

View File

@ -6,8 +6,8 @@ extern crate version_check;
use yansi::{Paint, Color::{Red, Yellow, Blue}};
// Specifies the minimum nightly version needed to compile Rocket.
const MIN_DATE: &'static str = "2019-04-05";
const MIN_VERSION: &'static str = "1.35.0-nightly";
const MIN_DATE: &'static str = "2021-05-18";
const MIN_VERSION: &'static str = "1.54.0-nightly";
macro_rules! err {
($version:expr, $date:expr, $msg:expr) => (

View File

@ -1,7 +1,7 @@
#![allow(incomplete_features)]
#![feature(specialization)]
#![feature(decl_macro)]
#![feature(try_trait)]
#![feature(try_trait_v2, control_flow_enum)]
#![feature(never_type)]
#![feature(proc_macro_hygiene)]
#![feature(crate_visibility_modifier)]

View File

@ -81,7 +81,7 @@
//! `None`.
use std::fmt;
use std::ops::Try;
use std::ops::{Try, ControlFlow, FromResidual};
use yansi::{Paint, Color};
@ -603,28 +603,43 @@ impl<S, E, F> Outcome<S, E, F> {
}
}
impl<S, E, F> Try for Outcome<S, E, F> {
type Ok = S;
type Error = Result<F, E>;
impl<Y, S, E: From<Y>, F> FromResidual<Result<!, Y>> for Outcome<S, E, F> {
fn from_residual(r: Result<!, Y>) -> Self {
#[allow(unreachable_code)]
match r {
Ok(v) => Outcome::Success(v),
Err(y) => Outcome::Failure(y.into()),
}
}
}
fn into_result(self) -> Result<Self::Ok, Self::Error> {
impl<S, X, E: From<X>, Y, F: From<Y>> FromResidual<Outcome<!, X, Y>> for Outcome<S, E, F> {
fn from_residual(r: Outcome<!, X, Y>) -> Self {
#[allow(unreachable_code)]
match r {
Outcome::Success(s) => Outcome::Success(s),
Outcome::Failure(x) => Outcome::Failure(x.into()),
Outcome::Forward(y) => Outcome::Forward(y.into()),
}
}
}
impl<A, B, C> Try for Outcome<A, B, C> {
type Output = A;
type Residual = Outcome<!, B, C>;
fn from_output(x: Self::Output) -> Self {
Outcome::Success(x)
}
fn branch(self) -> ControlFlow<Self::Residual, Self::Output> {
match self {
Success(val) => Ok(val),
Forward(val) => Err(Ok(val)),
Failure(val) => Err(Err(val)),
Outcome::Success(a) => ControlFlow::Continue(a),
Outcome::Forward(b) => ControlFlow::Break(Outcome::Forward(b)),
Outcome::Failure(c) => ControlFlow::Break(Outcome::Failure(c))
}
}
fn from_error(val: Self::Error) -> Self {
match val {
Ok(val) => Forward(val),
Err(val) => Failure(val),
}
}
fn from_ok(val: Self::Ok) -> Self {
Success(val)
}
}
impl<S, E, F> fmt::Debug for Outcome<S, E, F> {