Update UI tests for latest rustc.

This commit is contained in:
Sergio Benitez 2023-05-25 11:59:46 -07:00
parent e3f1b53efa
commit be92fe648b
7 changed files with 44 additions and 16 deletions

View File

@ -106,12 +106,12 @@ note: this function cannot be `main`
= note: this error originates in the attribute macro `rocket::launch` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> tests/ui-fail-nightly/async-entry.rs:73:41
--> tests/ui-fail-nightly/async-entry.rs:73:42
|
72 | fn rocket() -> _ {
| ------ this is not `async`
73 | let _ = rocket::build().launch().await;
| ^^^^^^ only allowed inside `async` functions and blocks
| ^^^^^ only allowed inside `async` functions and blocks
error[E0308]: mismatched types
--> tests/ui-fail-nightly/async-entry.rs:35:9

View File

@ -276,6 +276,8 @@ error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix<roc
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
| pub fn with_suffix<S>(self, suffix: S) -> SuffixedRouteUri<S::Output>
| ----------- required by a bound in this associated function
| where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`
@ -307,5 +309,7 @@ error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix<r
note: required by a bound in `RouteUriBuilder::with_suffix`
--> $WORKSPACE/core/http/src/uri/fmt/formatter.rs
|
| pub fn with_suffix<S>(self, suffix: S) -> SuffixedRouteUri<S::Output>
| ----------- required by a bound in this associated function
| where S: ValidRouteSuffix<Origin<'static>>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix`

View File

@ -110,8 +110,11 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks
error[E0308]: mismatched types
--> tests/ui-fail-stable/async-entry.rs:35:9
|
33 | async fn rocket() -> String {
| ------ expected `std::string::String` because of return type
34 | let _ = rocket::build().launch().await;
35 | rocket::build()
| ^^^^^^^^^^^^^^^ expected struct `String`, found struct `Rocket`
| ^^^^^^^^^^^^^^^ expected `String`, found `Rocket<Build>`
|
= note: expected struct `std::string::String`
found struct `Rocket<Build>`
@ -119,8 +122,11 @@ error[E0308]: mismatched types
error[E0308]: mismatched types
--> tests/ui-fail-stable/async-entry.rs:44:9
|
42 | async fn rocket() -> _ {
| - expected `Rocket<Build>` because of return type
43 | let _ = rocket::build().launch().await;
44 | "hi".to_string()
| ^^^^^^^^^^^^^^^^ expected struct `Rocket`, found struct `String`
| ^^^^^^^^^^^^^^^^ expected `Rocket<Build>`, found `String`
|
= note: expected struct `Rocket<Build>`
found struct `std::string::String`
@ -136,11 +142,29 @@ error[E0308]: mismatched types
26 | | }
| | ^- help: consider using a semicolon here: `;`
| |_____|
| expected `()`, found struct `Rocket`
| expected `()`, found `Rocket<Build>`
|
= note: expected unit type `()`
found struct `Rocket<Build>`
error[E0308]: mismatched types
--> tests/ui-fail-stable/async-entry.rs:35:9
|
35 | rocket::build()
| ^^^^^^^^^^^^^^^ expected `String`, found `Rocket<Build>`
|
= note: expected struct `std::string::String`
found struct `Rocket<Build>`
error[E0308]: mismatched types
--> tests/ui-fail-stable/async-entry.rs:44:9
|
44 | "hi".to_string()
| ^^^^^^^^^^^^^^^^ expected `Rocket<Build>`, found `String`
|
= note: expected struct `Rocket<Build>`
found struct `std::string::String`
error[E0277]: `main` has invalid return type `Rocket<Build>`
--> tests/ui-fail-stable/async-entry.rs:94:20
|

View File

@ -60,7 +60,7 @@ error[E0308]: arguments to this function are incorrect
30 | fn f3(_request: &Request, other: bool) { }
| ^^ - ---- an argument of type `bool` is missing
| |
| argument of type `Status` unexpected
| unexpected argument of type `Status`
|
note: function defined here
--> tests/ui-fail-stable/catch.rs:30:4

View File

@ -464,7 +464,7 @@ error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:147:24
|
147 | #[field(validate = 123)]
| ^^^ expected enum `Result`, found integer
| ^^^ expected `Result<(), Errors<'_>>`, found integer
|
= note: expected enum `Result<(), Errors<'_>>`
found type `{integer}`
@ -481,7 +481,7 @@ error[E0308]: mismatched types
159 | #[field(validate = ext(rocket::http::ContentType::HTML))]
| --- arguments to this function are incorrect
160 | first: String,
| ^^^^^^ expected enum `TempFile`, found struct `String`
| ^^^^^^ expected `&TempFile<'_>`, found `&String`
|
= note: expected reference `&TempFile<'_>`
found reference `&std::string::String`
@ -495,9 +495,9 @@ 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`
| ^^^ ------- expected `ContentType`, found `&str`
166 | first: String,
| ------ expected enum `TempFile`, found struct `String`
| ------ expected `&TempFile<'_>`, found `&String`
|
= note: expected reference `&TempFile<'_>`
found reference `&std::string::String`
@ -513,7 +513,7 @@ error[E0308]: mismatched types
171 | #[field(default = 123)]
| ^^^- help: try using a conversion method: `.to_string()`
| |
| expected struct `String`, found integer
| expected `String`, found integer
| arguments to this enum variant are incorrect
|
help: the type constructed contains `{integer}` due to the type of the argument passed
@ -530,7 +530,7 @@ error[E0308]: mismatched types
203 | #[field(default_with = Some("hi"))]
| ---- ^^^^- help: try using a conversion method: `.to_string()`
| | |
| | expected struct `String`, found `&str`
| | expected `String`, found `&str`
| arguments to this enum variant are incorrect
|
help: the type constructed contains `&'static str` due to the type of the argument passed

View File

@ -2,13 +2,13 @@ error[E0271]: type mismatch resolving `<String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected struct `Empty`, found `&str`
| ^^^^^^ expected `Empty`, found `&str`
error[E0271]: type mismatch resolving `<String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37
|
22 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected `&str`, found struct `Empty`
| ^^^^^^ expected `&str`, found `Empty`
error[E0277]: the trait bound `usize: FromUriParam<rocket::http::uri::fmt::Path, &str>` is not satisfied
--> tests/ui-fail-stable/typed-uri-bad-type.rs:45:22

View File

@ -276,10 +276,10 @@ error[E0271]: type mismatch resolving `<String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uris-bad-params.rs:15:37
|
15 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected struct `Empty`, found `&str`
| ^^^^^^ expected `Empty`, found `&str`
error[E0271]: type mismatch resolving `<String as FromParam<'_>>::Error == &str`
--> tests/ui-fail-stable/typed-uris-bad-params.rs:15:37
|
15 | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
| ^^^^^^ expected `&str`, found struct `Empty`
| ^^^^^^ expected `&str`, found `Empty`