Skip to content

Commit

Permalink
Update UI tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioBenitez committed Oct 27, 2023
1 parent 5bdafc2 commit 923b61e
Show file tree
Hide file tree
Showing 19 changed files with 578 additions and 397 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,102 @@ note: required by a bound in `ConnectionPool`
|
| pub struct ConnectionPool<K, C: Poolable> {
| ^^^^^^^^ required by this bound in `ConnectionPool`

error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool<A, Unknown>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:5:1
|
3 | struct Unknown;
| -------------- doesn't satisfy `Unknown: Poolable`
4 |
5 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ function or associated item cannot be called on `ConnectionPool<A, Unknown>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Unknown: Poolable`
note: the trait `Poolable` must be implemented
--> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs
|
| pub trait Poolable: Send + Sized + 'static {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `run` exists for struct `Connection<A, Unknown>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:5:1
|
3 | struct Unknown;
| -------------- doesn't satisfy `Unknown: Poolable`
4 |
5 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ method cannot be called on `Connection<A, Unknown>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Unknown: Poolable`
note: the trait `Poolable` must be implemented
--> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs
|
| pub trait Poolable: Send + Sized + 'static {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool<A, Unknown>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:5:1
|
3 | struct Unknown;
| -------------- doesn't satisfy `Unknown: Poolable`
4 |
5 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ function or associated item cannot be called on `ConnectionPool<A, Unknown>` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Unknown: Poolable`
note: the trait `Poolable` must be implemented
--> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs
|
| pub trait Poolable: Send + Sized + 'static {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool<B, Vec<i32>>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:8:1
|
8 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ function or associated item cannot be called on `ConnectionPool<B, Vec<i32>>` due to unsatisfied trait bounds
|
::: $RUST/alloc/src/vec/mod.rs
|
| pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
| ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<i32>: Poolable`
|
= note: the following trait bounds were not satisfied:
`Vec<i32>: Poolable`
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the method `run` exists for struct `Connection<B, Vec<i32>>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:8:1
|
8 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ method cannot be called on `Connection<B, Vec<i32>>` due to unsatisfied trait bounds
|
::: $RUST/alloc/src/vec/mod.rs
|
| pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
| ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<i32>: Poolable`
|
= note: the following trait bounds were not satisfied:
`Vec<i32>: Poolable`
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool<B, Vec<i32>>`, but its trait bounds were not satisfied
--> tests/ui-fail-nightly/database-types.rs:8:1
|
8 | #[database("foo")]
| ^^^^^^^^^^^^^^^^^^ function or associated item cannot be called on `ConnectionPool<B, Vec<i32>>` due to unsatisfied trait bounds
|
::: $RUST/alloc/src/vec/mod.rs
|
| pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
| ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec<i32>: Poolable`
|
= note: the following trait bounds were not satisfied:
`Vec<i32>: Poolable`
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ error: `database` attribute can only be used on structs
| ^^^^

error: `database` attribute can only be applied to structs with exactly one unnamed field
--- help: example: `struct MyDatabase(diesel::SqliteConnection);`
= help: example: `struct MyDatabase(diesel::SqliteConnection);`
--> tests/ui-fail-stable/database-syntax.rs:43:11
|
43 | struct Bar(Connection, Connection);
Expand Down
26 changes: 13 additions & 13 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,20 @@ 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[E0277]: `main` has invalid return type `Rocket<Build>`
--> tests/ui-fail-nightly/async-entry.rs:94:20
|
94 | async fn main() -> rocket::Rocket<rocket::Build> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` can only return types that implement `Termination`
|
= help: consider using `()`, or a `Result`

error[E0308]: mismatched types
--> tests/ui-fail-nightly/async-entry.rs:35:9
Expand Down Expand Up @@ -141,9 +149,9 @@ error[E0308]: mismatched types
--> tests/ui-fail-nightly/async-entry.rs:24:21
|
24 | async fn main() {
| ^ expected `()` because of default return type
| _____________________|
| |
| ____________________-^
| | |
| | expected `()` because of default return type
25 | | rocket::build()
26 | | }
| | ^- help: consider using a semicolon here: `;`
Expand All @@ -170,11 +178,3 @@ error[E0308]: mismatched types
|
= note: expected struct `Rocket<Build>`
found struct `std::string::String`

error[E0277]: `main` has invalid return type `Rocket<Build>`
--> tests/ui-fail-nightly/async-entry.rs:94:20
|
94 | async fn main() -> rocket::Rocket<rocket::Build> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` can only return types that implement `Termination`
|
= help: consider using `()`, or a `Result`
64 changes: 32 additions & 32 deletions core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
<rocket::Either<T, E> as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<std::fs::File as Responder<'r, 'static>>
and $N others

error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
Expand All @@ -26,14 +26,14 @@ error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied
| ^^^^ the trait `Responder<'_, '_>` is not implemented for `bool`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
<rocket::Either<T, E> as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<std::fs::File as Responder<'r, 'static>>
and $N others

error[E0308]: mismatched types
Expand All @@ -59,14 +59,14 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
<rocket::Either<T, E> as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<std::fs::File as Responder<'r, 'static>>
and $N others

error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
Expand All @@ -78,12 +78,12 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied
| ^^^^^ the trait `Responder<'_, '_>` is not implemented for `usize`
|
= help: the following other types implement trait `Responder<'r, 'o>`:
<&'o [u8] as Responder<'r, 'o>>
<&'o str as Responder<'r, 'o>>
<() as Responder<'r, 'static>>
<(ContentType, R) as Responder<'r, 'o>>
<(Status, R) as Responder<'r, 'o>>
<Accepted<R> as Responder<'r, 'o>>
<Arc<[u8]> as Responder<'r, 'static>>
<Arc<str> as Responder<'r, 'static>>
<rocket::Either<T, E> as Responder<'r, 'o>>
<Box<str> as Responder<'r, 'static>>
<Box<[u8]> as Responder<'r, 'static>>
<Box<T> as Responder<'r, 'o>>
<Cow<'o, R> as Responder<'r, 'o>>
<rocket::tokio::fs::File as Responder<'r, 'static>>
<EventStream<S> as Responder<'r, 'r>>
<std::fs::File as Responder<'r, 'static>>
and $N others
90 changes: 74 additions & 16 deletions core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
| ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`
|
= help: the following other types implement trait `FromFormField<'v>`:
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
bool
isize
i8
i16
i32
i64
i128
usize
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`

Expand All @@ -23,13 +23,71 @@ error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
| ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`
|
= help: the following other types implement trait `FromFormField<'v>`:
&'v [u8]
&'v str
Capped<&'v [u8]>
Capped<&'v str>
Capped<Cow<'v, str>>
Capped<TempFile<'v>>
Capped<std::string::String>
Cow<'v, str>
bool
isize
i8
i16
i32
i64
i128
usize
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`

error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied
--> tests/ui-fail-nightly/from_form_type_errors.rs:5:10
|
5 | #[derive(FromForm)]
| ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
isize
i8
i16
i32
i64
i128
usize
and $N others
= note: required for `Unknown` to implement `FromForm<'r>`
note: required because it appears within the type `FromFormGeneratedContext<'r>`
--> tests/ui-fail-nightly/from_form_type_errors.rs:6:8
|
6 | struct BadType3 {
| ^^^^^^^^
note: required by a bound in `rocket::form::FromForm::Context`
--> $WORKSPACE/core/lib/src/form/from_form.rs
|
| type Context: Send;
| ^^^^ required by this bound in `FromForm::Context`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Foo<usize>: FromFormField<'_>` is not satisfied
--> tests/ui-fail-nightly/from_form_type_errors.rs:12:10
|
12 | #[derive(FromForm)]
| ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo<usize>`
|
= help: the following other types implement trait `FromFormField<'v>`:
bool
isize
i8
i16
i32
i64
i128
usize
and $N others
= note: required for `Foo<usize>` to implement `FromForm<'r>`
note: required because it appears within the type `FromFormGeneratedContext<'r>`
--> tests/ui-fail-nightly/from_form_type_errors.rs:13:8
|
13 | struct Other {
| ^^^^^
note: required by a bound in `rocket::form::FromForm::Context`
--> $WORKSPACE/core/lib/src/form/from_form.rs
|
| type Context: Send;
| ^^^^ required by this bound in `FromForm::Context`
= note: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info)
Loading

0 comments on commit 923b61e

Please sign in to comment.