Update UI tests for latest nightly, stable.

This commit is contained in:
Sergio Benitez 2022-08-31 13:52:40 -07:00
parent 885cdfd61c
commit 13732f8a6b
11 changed files with 98 additions and 65 deletions

View File

@ -74,7 +74,7 @@ note: function defined here
--> tests/ui-fail-nightly/catch.rs:30:4
|
30 | fn f3(_request: &Request, other: bool) { }
| ^^---------------------
| ^^ ------------------ -----------
help: did you mean
|
29 | f3(bool, /* bool */)

View File

@ -1,8 +1,10 @@
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-nightly/catch_type_errors.rs:5:1
--> tests/ui-fail-nightly/catch_type_errors.rs:6:30
|
5 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
| ------------- required by a bound introduced by this call
6 | fn f1(_request: &Request) -> usize {
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
@ -14,13 +16,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and 40 others
= note: this error originates in the attribute macro `catch` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-nightly/catch_type_errors.rs:10:1
--> tests/ui-fail-nightly/catch_type_errors.rs:11:30
|
10 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `Responder<'_, '_>` is not implemented for `bool`
| ------------- required by a bound introduced by this call
11 | fn f2(_request: &Request) -> bool {
| ^^^^ the trait `Responder<'_, '_>` is not implemented for `bool`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
@ -32,7 +35,6 @@ error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and 40 others
= note: this error originates in the attribute macro `catch` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> tests/ui-fail-nightly/catch_type_errors.rs:16:17
@ -46,13 +48,15 @@ note: function defined here
--> tests/ui-fail-nightly/catch_type_errors.rs:16:4
|
16 | fn f3(_request: bool) -> usize {
| ^^-
| ^^ --------------
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-nightly/catch_type_errors.rs:15:1
--> tests/ui-fail-nightly/catch_type_errors.rs:16:26
|
15 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
| ------------- required by a bound introduced by this call
16 | fn f3(_request: bool) -> usize {
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
@ -64,13 +68,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and 40 others
= note: this error originates in the attribute macro `catch` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-nightly/catch_type_errors.rs:20:1
--> tests/ui-fail-nightly/catch_type_errors.rs:21:12
|
20 | #[catch(404)]
| ^^^^^^^^^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
| ------------- required by a bound introduced by this call
21 | fn f4() -> usize {
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
@ -82,4 +87,3 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
and 40 others
= note: this error originates in the attribute macro `catch` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -524,4 +524,4 @@ error[E0277]: the trait bound `bool: From<&str>` is not satisfied
209 | #[field(default = "no conversion")]
| ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool`
|
= note: required because of the requirements on the impl of `Into<bool>` for `&str`
= note: required for `&str` to implement `Into<bool>`

View File

@ -14,7 +14,7 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
IpAddr
Ipv4Addr
and 38 others
= note: required because of the requirements on the impl of `FromForm<'r>` for `Unknown`
= note: required for `Unknown` to implement `FromForm<'r>`
error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
--> tests/ui-fail-nightly/from_form_type_errors.rs:14:12
@ -32,4 +32,4 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
IpAddr
Ipv4Addr
and 38 others
= note: required because of the requirements on the impl of `FromForm<'r>` for `Foo<usize>`
= note: required for `Foo<usize>` to implement `FromForm<'r>`

View File

@ -31,7 +31,7 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and 4 others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `u8`
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs
|
@ -71,7 +71,7 @@ error[E0277]: the trait bound `Header<'_>: From<u8>` is not satisfied
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and 4 others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `u8`
= note: required for `u8` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs
|
@ -94,7 +94,7 @@ error[E0277]: the trait bound `Header<'_>: From<std::string::String>` is not sat
<Header<'static> as From<&Prefetch>>
<Header<'static> as From<&Referrer>>
and 4 others
= note: required because of the requirements on the impl of `Into<Header<'_>>` for `std::string::String`
= note: required for `std::string::String` to implement `Into<Header<'_>>`
note: required by a bound in `rocket::Response::<'r>::set_header`
--> $WORKSPACE/core/lib/src/response/response.rs
|

View File

@ -43,7 +43,7 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
IpAddr
Ipv4Addr
and 38 others
= note: required because of the requirements on the impl of `FromForm<'_>` for `Q`
= note: required for `Q` to implement `FromForm<'_>`
error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
--> tests/ui-fail-nightly/route-type-errors.rs:15:12
@ -61,7 +61,7 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied
IpAddr
Ipv4Addr
and 38 others
= note: required because of the requirements on the impl of `FromForm<'_>` for `Q`
= note: required for `Q` to implement `FromForm<'_>`
error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied
--> tests/ui-fail-nightly/route-type-errors.rs:18:12

View File

@ -1,3 +1,15 @@
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^^^^^^^^^^^^^^^ expected enum `Infallible`, found `&str`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^^^^^^^^^^^^^^^ expected `&str`, found enum `Infallible`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:45:22
|
@ -82,7 +94,7 @@ error[E0277]: the trait bound `i32: FromUriParam<rocket::http::uri::fmt::Path, s
<i128 as FromUriParam<P, &'x i128>>
<i128 as FromUriParam<P, &'x mut i128>>
and 34 others
= note: required because of the requirements on the impl of `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>` for `std::option::Option<i32>`
= note: required for `std::option::Option<i32>` to implement `FromUriParam<rocket::http::uri::fmt::Path, std::option::Option<{integer}>>`
error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>` is not satisfied
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:56:42
@ -100,7 +112,7 @@ error[E0277]: the trait bound `std::string::String: FromUriParam<rocket::http::u
<std::string::String as FromUriParam<P, &'a str>>
<std::string::String as FromUriParam<P, &'x &'a str>>
and 4 others
= note: required because of the requirements on the impl of `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>` for `Result<std::string::String, &str>`
= note: required for `Result<std::string::String, &str>` to implement `FromUriParam<rocket::http::uri::fmt::Path, Result<_, _>>`
error[E0277]: the trait bound `isize: FromUriParam<rocket::http::uri::fmt::Query, &str>` is not satisfied
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:58:19
@ -360,15 +372,3 @@ note: required by a bound in `RouteUriBuilder::with_suffix`
|
| where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^^^^^^^^^^^^^^^ expected enum `Infallible`, found `&str`
error[E0271]: type mismatch resolving `<std::string::String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^^^^^^^^^^^^^^^ expected `&str`, found enum `Infallible`

View File

@ -14,7 +14,7 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -37,7 +37,7 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -60,7 +60,7 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -83,9 +83,9 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType`
= note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -108,9 +108,9 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType`
= note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -133,9 +133,9 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
= note: 1 redundant requirement hidden
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Query>` for `&&BadType`
= note: required for `&&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Query>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
@ -158,7 +158,7 @@ error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Path>
<Bar4 as UriDisplay<rocket::http::uri::fmt::Query>>
<Bar5 as UriDisplay<rocket::http::uri::fmt::Query>>
and 48 others
= note: required because of the requirements on the impl of `UriDisplay<rocket::http::uri::fmt::Path>` for `&BadType`
= note: required for `&BadType` to implement `UriDisplay<rocket::http::uri::fmt::Path>`
note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|

View File

@ -54,14 +54,20 @@ error: unexpected attribute parameter: `message`
26 | #[catch(400, message = "foo")]
| ^^^^^^^
error[E0308]: mismatched types
--> tests/ui-fail-stable/catch.rs:30:17
error[E0308]: arguments to this function are incorrect
--> tests/ui-fail-stable/catch.rs:30:4
|
30 | fn f3(_request: &Request, other: bool) { }
| ^ expected `&rocket::Request<'_>`, found struct `Status`
error[E0308]: mismatched types
--> tests/ui-fail-stable/catch.rs:30:34
| ^^ - ---- an argument of type `bool` is missing
| |
| argument of type `&rocket::Request<'_>` unexpected
|
note: function defined here
--> tests/ui-fail-stable/catch.rs:30:4
|
30 | fn f3(_request: &Request, other: bool) { }
| ^^^^ expected `bool`, found `&rocket::Request<'_>`
| ^^---------------------
help: did you mean
|
29 | f3(bool, /* bool */)
|

View File

@ -40,7 +40,15 @@ error[E0308]: mismatched types
--> tests/ui-fail-stable/catch_type_errors.rs:16:17
|
16 | fn f3(_request: bool) -> usize {
| ^^^^ expected `bool`, found `&rocket::Request<'_>`
| -- ^^^^ expected `bool`, found `&rocket::Request<'_>`
| |
| arguments to this function are incorrect
|
note: function defined here
--> tests/ui-fail-stable/catch_type_errors.rs:16:4
|
16 | fn f3(_request: bool) -> usize {
| ^^-
error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
--> tests/ui-fail-stable/catch_type_errors.rs:16:26

View File

@ -480,33 +480,45 @@ error[E0308]: mismatched types
error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:160:12
|
159 | #[field(validate = ext(rocket::http::ContentType::HTML))]
| --- arguments to this function are incorrect
160 | first: String,
| ^^^^^^ expected enum `TempFile`, found struct `std::string::String`
|
= note: expected reference `&TempFile<'_>`
found reference `&std::string::String`
error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:166:12
note: function defined here
--> $WORKSPACE/core/lib/src/form/validate.rs
|
| pub fn ext<'v>(file: &TempFile<'_>, r#type: ContentType) -> Result<'v, ()> {
| ^^^
error[E0308]: arguments to this function are incorrect
--> tests/ui-fail-stable/from_form.rs:165:24
|
165 | #[field(validate = ext("hello"))]
| ^^^ ------- expected struct `ContentType`, found `&str`
166 | first: String,
| ^^^^^^ expected enum `TempFile`, found struct `std::string::String`
| ------ expected enum `TempFile`, found struct `std::string::String`
|
= note: expected reference `&TempFile<'_>`
found reference `&std::string::String`
error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:165:28
note: function defined here
--> $WORKSPACE/core/lib/src/form/validate.rs
|
165 | #[field(validate = ext("hello"))]
| ^^^^^^^ expected struct `ContentType`, found `&str`
| pub fn ext<'v>(file: &TempFile<'_>, r#type: ContentType) -> Result<'v, ()> {
| ^^^
error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:171:23
|
171 | #[field(default = 123)]
| ^^^ expected struct `std::string::String`, found integer
| ^^^
| |
| expected struct `std::string::String`, found integer
| arguments to this enum variant are incorrect
|
note: tuple variant defined here
help: try using a conversion method
|
171 | #[field(default = 123.to_string())]
@ -518,8 +530,11 @@ error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:203:33
|
203 | #[field(default_with = Some("hi"))]
| ^^^^ expected struct `std::string::String`, found `&str`
| ---- ^^^^ expected struct `std::string::String`, found `&str`
| |
| arguments to this enum variant are incorrect
|
note: tuple variant defined here
help: try using a conversion method
|
203 | #[field(default_with = Some("hi".to_string()))]