Skip to content

Commit

Permalink
Update UI tests for latest rustc.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed May 25, 2023
1 parent e3f1b53 commit be92fe6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 16 deletions.
4 changes: 2 additions & 2 deletions core/codegen/tests/ui-fail-nightly/async-entry.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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`
30 changes: 27 additions & 3 deletions core/codegen/tests/ui-fail-stable/async-entry.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,23 @@ 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>`

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`
Expand All @@ -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
|
Expand Down
2 changes: 1 addition & 1 deletion core/codegen/tests/ui-fail-stable/catch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions core/codegen/tests/ui-fail-stable/from_form.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions core/codegen/tests/ui-fail-stable/typed-uri-bad-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`

0 comments on commit be92fe6

Please sign in to comment.