diff --git a/contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr b/contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr index 8f3a5816..17e020a1 100644 --- a/contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr +++ b/contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr @@ -1,11 +1,11 @@ error: invalid value: expected string literal - --> $DIR/database-syntax.rs:4:12 + --> tests/ui-fail-stable/database-syntax.rs:4:12 | 4 | #[database(123)] | ^^^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:3:10 + --> tests/ui-fail-stable/database-syntax.rs:3:10 | 3 | #[derive(Database)] | ^^^^^^^^ @@ -13,13 +13,13 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected key/value `key = value` - --> $DIR/database-syntax.rs:8:25 + --> tests/ui-fail-stable/database-syntax.rs:8:25 | 8 | #[database("some-name", "another")] | ^^^^^^^^^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:7:10 + --> tests/ui-fail-stable/database-syntax.rs:7:10 | 7 | #[derive(Database)] | ^^^^^^^^ @@ -27,13 +27,13 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: unexpected attribute parameter: `name` - --> $DIR/database-syntax.rs:12:25 + --> tests/ui-fail-stable/database-syntax.rs:12:25 | 12 | #[database("some-name", name = "another")] - | ^^^^ + | ^^^^^^^^^^^^^^^^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:11:10 + --> tests/ui-fail-stable/database-syntax.rs:11:10 | 11 | #[derive(Database)] | ^^^^^^^^ @@ -41,13 +41,14 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: enums are not supported - --> $DIR/database-syntax.rs:16:1 + --> tests/ui-fail-stable/database-syntax.rs:16:1 | -16 | #[database("foo")] - | ^ +16 | / #[database("foo")] +17 | | enum D { } + | |___________^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:15:10 + --> tests/ui-fail-stable/database-syntax.rs:15:10 | 15 | #[derive(Database)] | ^^^^^^^^ @@ -55,13 +56,13 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: missing `#[database("name")]` attribute - --> $DIR/database-syntax.rs:20:1 + --> tests/ui-fail-stable/database-syntax.rs:20:1 | 20 | struct E(deadpool_postgres::Pool); - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:19:10 + --> tests/ui-fail-stable/database-syntax.rs:19:10 | 19 | #[derive(Database)] | ^^^^^^^^ @@ -69,13 +70,14 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: struct must have exactly one unnamed field - --> $DIR/database-syntax.rs:23:1 + --> tests/ui-fail-stable/database-syntax.rs:23:1 | -23 | #[database("foo")] - | ^ +23 | / #[database("foo")] +24 | | struct F; + | |_________^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:22:10 + --> tests/ui-fail-stable/database-syntax.rs:22:10 | 22 | #[derive(Database)] | ^^^^^^^^ @@ -83,13 +85,14 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: struct must have exactly one unnamed field - --> $DIR/database-syntax.rs:27:1 + --> tests/ui-fail-stable/database-syntax.rs:27:1 | -27 | #[database("foo")] - | ^ +27 | / #[database("foo")] +28 | | struct G(deadpool_postgres::Pool, deadpool_postgres::Pool); + | |___________________________________________________________^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:26:10 + --> tests/ui-fail-stable/database-syntax.rs:26:10 | 26 | #[derive(Database)] | ^^^^^^^^ @@ -97,13 +100,16 @@ error: [note] error occurred while deriving `Database` = note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info) error: named structs are not supported - --> $DIR/database-syntax.rs:31:1 + --> tests/ui-fail-stable/database-syntax.rs:31:1 | -31 | #[database("foo")] - | ^ +31 | / #[database("foo")] +32 | | struct H { +33 | | foo: deadpool_postgres::Pool, +34 | | } + | |_^ error: [note] error occurred while deriving `Database` - --> $DIR/database-syntax.rs:30:10 + --> tests/ui-fail-stable/database-syntax.rs:30:10 | 30 | #[derive(Database)] | ^^^^^^^^ diff --git a/contrib/sync_db_pools/codegen/src/database.rs b/contrib/sync_db_pools/codegen/src/database.rs index b5e4bc97..51de85c5 100644 --- a/contrib/sync_db_pools/codegen/src/database.rs +++ b/contrib/sync_db_pools/codegen/src/database.rs @@ -73,15 +73,16 @@ pub fn database_attr(attr: TokenStream, input: TokenStream) -> Result - #(#attrs)* #vis struct #guard_type(#root::Connection); + #(#attrs)* #vis struct #guard_type(#[allow(dead_code)] #root::Connection); }; let pool = quote_spanned!(span => #root::ConnectionPool); let conn = quote_spanned!(span => #root::Connection); - Ok(quote! { + Ok(quote_spanned! { span => #request_guard_type + #[allow(dead_code)] impl #guard_type { /// Returns a fairing that initializes the database connection pool. pub fn fairing() -> impl #rocket::fairing::Fairing { diff --git a/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.stderr b/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.stderr index 64be8774..c503fa6d 100644 --- a/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.stderr +++ b/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.stderr @@ -10,17 +10,22 @@ note: required by a bound in `rocket_sync_db_pools::Connection` | pub struct Connection { | ^^^^^^^^ required by this bound in `Connection` -error[E0277]: the trait bound `Vec: Poolable` is not satisfied - --> tests/ui-fail-nightly/database-types.rs:9:10 +error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 | -9 | struct B(Vec); - | ^^^^^^^^ the trait `Poolable` is not implemented for `Vec` +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` due to unsatisfied trait bounds | -note: required by a bound in `rocket_sync_db_pools::Connection` - --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + = 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 struct Connection { - | ^^^^^^^^ required by this bound in `Connection` + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `Unknown: Poolable` is not satisfied --> tests/ui-fail-nightly/database-types.rs:6:10 @@ -34,6 +39,66 @@ note: required by a bound in `ConnectionPool` | pub struct ConnectionPool { | ^^^^^^^^ required by this bound in `ConnectionPool` +error[E0599]: the method `run` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ method cannot be called on `Connection` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `Vec: Poolable` is not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ the trait `Poolable` is not implemented for `Vec` + | +note: required by a bound in `rocket_sync_db_pools::Connection` + --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ^^^^^^^^ required by this bound in `Connection` + +error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + error[E0277]: the trait bound `Vec: Poolable` is not satisfied --> tests/ui-fail-nightly/database-types.rs:9:10 | @@ -45,3 +110,158 @@ note: required by a bound in `ConnectionPool` | | pub struct ConnectionPool { | ^^^^^^^^ required by this bound in `ConnectionPool` + +error[E0599]: the method `run` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ method cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `pool` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `from_request` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `Connection` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: FromRequest<'_>` + | + = note: the following trait bounds were not satisfied: + `Unknown: Poolable` + which is required by `rocket_sync_db_pools::Connection: FromRequest<'_>` +note: the trait `Poolable` must be implemented + --> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs + | + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `abort` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `Connection` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: Sentinel` + | + = note: the following trait bounds were not satisfied: + `Unknown: Poolable` + which is required by `rocket_sync_db_pools::Connection: Sentinel` +note: the trait `Poolable` must be implemented + --> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs + | + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: items from traits can only be used if the trait is in scope +help: trait `DefaultSentinel` which provides `abort` is implemented but not in scope; perhaps you want to import it + | +1 + use crate::rocket_sync_db_pools::rocket::sentinel::resolution::DefaultSentinel; + | + +error[E0599]: the function or associated item `pool` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `from_request` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: FromRequest<'_>` + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + which is required by `rocket_sync_db_pools::Connection>: FromRequest<'_>` + +error[E0599]: the function or associated item `abort` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-nightly/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: Sentinel` + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + which is required by `rocket_sync_db_pools::Connection>: Sentinel` + = help: items from traits can only be used if the trait is in scope +help: trait `DefaultSentinel` which provides `abort` is implemented but not in scope; perhaps you want to import it + | +1 + use crate::rocket_sync_db_pools::rocket::sentinel::resolution::DefaultSentinel; + | diff --git a/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr b/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr index e850902e..09270c3b 100644 --- a/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr +++ b/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr @@ -28,7 +28,7 @@ error: `database` attribute can only be used on structs --> tests/ui-fail-stable/database-syntax.rs:40:1 | 40 | enum Foo { } - | ^^^^ + | ^^^^^^^^^^^^^ error: `database` attribute can only be applied to structs with exactly one unnamed field = help: example: `struct MyDatabase(diesel::SqliteConnection);` @@ -41,16 +41,16 @@ error: `database` attribute can only be used on structs --> tests/ui-fail-stable/database-syntax.rs:46:1 | 46 | union Baz { } - | ^^^^^ + | ^^^^^^^^^^^^^^ error: `database` attribute cannot be applied to structs with generics --> tests/ui-fail-stable/database-syntax.rs:49:9 | 49 | struct E<'r>(&'r str); - | ^ + | ^^^^ error: `database` attribute cannot be applied to structs with generics --> tests/ui-fail-stable/database-syntax.rs:52:9 | 52 | struct F(T); - | ^ + | ^^^ diff --git a/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.stderr b/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.stderr index c699597e..f7d6cc68 100644 --- a/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.stderr +++ b/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.stderr @@ -10,17 +10,22 @@ note: required by a bound in `rocket_sync_db_pools::Connection` | pub struct Connection { | ^^^^^^^^ required by this bound in `Connection` -error[E0277]: the trait bound `Vec: Poolable` is not satisfied - --> tests/ui-fail-stable/database-types.rs:9:10 +error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 | -9 | struct B(Vec); - | ^^^ the trait `Poolable` is not implemented for `Vec` +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` due to unsatisfied trait bounds | -note: required by a bound in `rocket_sync_db_pools::Connection` - --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + = 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 struct Connection { - | ^^^^^^^^ required by this bound in `Connection` + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `Unknown: Poolable` is not satisfied --> tests/ui-fail-stable/database-types.rs:6:10 @@ -34,14 +39,229 @@ note: required by a bound in `ConnectionPool` | pub struct ConnectionPool { | ^^^^^^^^ required by this bound in `ConnectionPool` +error[E0599]: the method `run` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ method cannot be called on `Connection` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0277]: the trait bound `Vec: Poolable` is not satisfied --> tests/ui-fail-stable/database-types.rs:9:10 | 9 | struct B(Vec); - | ^^^ the trait `Poolable` is not implemented for `Vec` + | ^^^^^^^^ the trait `Poolable` is not implemented for `Vec` + | +note: required by a bound in `rocket_sync_db_pools::Connection` + --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ^^^^^^^^ required by this bound in `Connection` + +error[E0599]: the function or associated item `fairing` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0277]: the trait bound `Vec: Poolable` is not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ the trait `Poolable` is not implemented for `Vec` | note: required by a bound in `ConnectionPool` --> $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs | | pub struct ConnectionPool { | ^^^^^^^^ required by this bound in `ConnectionPool` + +error[E0599]: the method `run` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ method cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `get_one` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `pool` exists for struct `ConnectionPool`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `ConnectionPool` 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `from_request` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `Connection` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: FromRequest<'_>` + | + = note: the following trait bounds were not satisfied: + `Unknown: Poolable` + which is required by `rocket_sync_db_pools::Connection: FromRequest<'_>` +note: the trait `Poolable` must be implemented + --> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs + | + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0599]: the function or associated item `abort` exists for struct `Connection`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:6:10 + | +3 | struct Unknown; + | -------------- doesn't satisfy `Unknown: Poolable` +... +6 | struct A(Unknown); + | ^^^^^^^ function or associated item cannot be called on `Connection` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: Sentinel` + | + = note: the following trait bounds were not satisfied: + `Unknown: Poolable` + which is required by `rocket_sync_db_pools::Connection: Sentinel` +note: the trait `Poolable` must be implemented + --> $WORKSPACE/contrib/sync_db_pools/lib/src/poolable.rs + | + | pub trait Poolable: Send + Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = help: items from traits can only be used if the trait is in scope +help: trait `DefaultSentinel` which provides `abort` is implemented but not in scope; perhaps you want to import it + | +1 + use crate::rocket_sync_db_pools::rocket::sentinel::resolution::DefaultSentinel; + | + +error[E0599]: the function or associated item `pool` exists for struct `ConnectionPool>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `ConnectionPool>` due to unsatisfied trait bounds + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + +error[E0599]: the function or associated item `from_request` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: FromRequest<'_>` + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + which is required by `rocket_sync_db_pools::Connection>: FromRequest<'_>` + +error[E0599]: the function or associated item `abort` exists for struct `Connection>`, but its trait bounds were not satisfied + --> tests/ui-fail-stable/database-types.rs:9:10 + | +9 | struct B(Vec); + | ^^^^^^^^ function or associated item cannot be called on `Connection>` due to unsatisfied trait bounds + | + ::: $WORKSPACE/contrib/sync_db_pools/lib/src/connection.rs + | + | pub struct Connection { + | ------------------------------------- doesn't satisfy `_: Sentinel` + | + ::: $RUST/alloc/src/vec/mod.rs + | + | pub struct Vec { + | ------------------------------------------------------------------------------------------------ doesn't satisfy `Vec: Poolable` + | + = note: the following trait bounds were not satisfied: + `Vec: Poolable` + which is required by `rocket_sync_db_pools::Connection>: Sentinel` + = help: items from traits can only be used if the trait is in scope +help: trait `DefaultSentinel` which provides `abort` is implemented but not in scope; perhaps you want to import it + | +1 + use crate::rocket_sync_db_pools::rocket::sentinel::resolution::DefaultSentinel; + | diff --git a/contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs b/contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs index 1add1d0d..09101085 100644 --- a/contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs +++ b/contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs @@ -11,15 +11,15 @@ impl r2d2::ManageConnection for Manager { type Error = std::convert::Infallible; fn connect(&self) -> Result { Ok(Connection) } - fn is_valid(&self, conn: &mut Self::Connection) -> Result<(), Self::Error> { Ok(()) } - fn has_broken(&self, conn: &mut Self::Connection) -> bool { true } + fn is_valid(&self, _: &mut Self::Connection) -> Result<(), Self::Error> { Ok(()) } + fn has_broken(&self, _: &mut Self::Connection) -> bool { true } } impl Poolable for Connection { type Manager = Manager; type Error = std::convert::Infallible; - fn pool(db_name: &str, rocket: &Rocket) -> PoolResult { + fn pool(_: &str, _: &Rocket) -> PoolResult { todo!() } } diff --git a/contrib/sync_db_pools/lib/tests/shutdown.rs b/contrib/sync_db_pools/lib/tests/shutdown.rs index eb1c53d1..958270b2 100644 --- a/contrib/sync_db_pools/lib/tests/shutdown.rs +++ b/contrib/sync_db_pools/lib/tests/shutdown.rs @@ -5,7 +5,6 @@ mod sqlite_shutdown_test { use rocket_sync_db_pools::database; #[database("test")] - #[allow(dead_code)] struct Pool(diesel::SqliteConnection); async fn rocket() -> Rocket { diff --git a/core/codegen/tests/ui-fail-nightly/async-entry.stderr b/core/codegen/tests/ui-fail-nightly/async-entry.stderr index 3a763033..a1cba990 100644 --- a/core/codegen/tests/ui-fail-nightly/async-entry.stderr +++ b/core/codegen/tests/ui-fail-nightly/async-entry.stderr @@ -22,6 +22,7 @@ note: this function is not `main` | 11 | async fn foo() { } | ^^^ + = note: apply `#[suppress(arbitrary_main)]` before the item to suppress this lint = note: this warning originates in the attribute macro `rocket::main` (in Nightly builds, run with -Z macro-backtrace for more info) error: attribute can only be applied to `async` functions @@ -109,7 +110,15 @@ error[E0728]: `await` is only allowed inside `async` functions and blocks --> tests/ui-fail-nightly/async-entry.rs:73:42 | 72 | fn rocket() -> _ { - | ------ this is not `async` + | ---------------- this is not `async` +73 | let _ = rocket::build().launch().await; + | ^^^^^ only allowed inside `async` functions and blocks + +error[E0728]: `await` is only allowed inside `async` functions and blocks + --> 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 diff --git a/core/codegen/tests/ui-fail-nightly/catch.stderr b/core/codegen/tests/ui-fail-nightly/catch.stderr index 823904b4..0d02bebd 100644 --- a/core/codegen/tests/ui-fail-nightly/catch.stderr +++ b/core/codegen/tests/ui-fail-nightly/catch.stderr @@ -65,16 +65,16 @@ error: unexpected attribute parameter: `message` error[E0308]: arguments to this function are incorrect --> tests/ui-fail-nightly/catch.rs:30:4 | -30 | fn f3(_request: &Request, other: bool) { } - | ^^ -------- ---- an argument of type `bool` is missing +30 | fn f3(_request: &Request, _other: bool) { } + | ^^ -------- ---- an argument of type `bool` is missing | | | unexpected argument of type `Status` | note: function defined here --> tests/ui-fail-nightly/catch.rs:30:4 | -30 | fn f3(_request: &Request, other: bool) { } - | ^^ ------------------ ----------- +30 | fn f3(_request: &Request, _other: bool) { } + | ^^ ------------------ ------------ help: provide the argument | 29 | f3(bool, /* bool */) diff --git a/core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr b/core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr index a461ccbd..1f46c0f9 100644 --- a/core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr +++ b/core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr @@ -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>`: - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as Responder<'r, 'o>> - as Responder<'r, 'o>> - > - as Responder<'r, 'r>> - > + <&'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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied @@ -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>`: - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as Responder<'r, 'o>> - as Responder<'r, 'o>> - > - as Responder<'r, 'r>> - > + <&'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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others error[E0308]: mismatched types @@ -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>`: - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as Responder<'r, 'o>> - as Responder<'r, 'o>> - > - as Responder<'r, 'r>> - > + <&'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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied @@ -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>`: - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as Responder<'r, 'o>> - as Responder<'r, 'o>> - > - as Responder<'r, 'r>> - > + <&'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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others diff --git a/core/codegen/tests/ui-fail-nightly/from_form.stderr b/core/codegen/tests/ui-fail-nightly/from_form.stderr index 1dee7d31..0a40c37d 100644 --- a/core/codegen/tests/ui-fail-nightly/from_form.stderr +++ b/core/codegen/tests/ui-fail-nightly/from_form.stderr @@ -521,7 +521,7 @@ error[E0277]: the trait bound `bool: From<&str>` is not satisfied --> tests/ui-fail-nightly/from_form.rs:209:23 | 209 | #[field(default = "no conversion")] - | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool` + | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool`, which is required by `&str: Into<_>` | = help: the following other types implement trait `From`: > diff --git a/core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr b/core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr index 3bee4394..b360fe56 100644 --- a/core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr +++ b/core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr @@ -2,34 +2,210 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied --> tests/ui-fail-nightly/from_form_type_errors.rs:7:12 | 7 | field: Unknown, - | ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown` + | ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>` | = help: the following other types implement trait `FromFormField<'v>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> and $N others = note: required for `Unknown` 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`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + 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: FromFormField<'_>` is not satisfied --> tests/ui-fail-nightly/from_form_type_errors.rs:14:12 | 14 | field: Foo, - | ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo` + | ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `Foo: FromForm<'r>` | = help: the following other types implement trait `FromFormField<'v>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> and $N others = note: required for `Foo` to implement `FromForm<'r>` + +error[E0277]: the trait bound `Foo: 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`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others + = note: required for `Foo` 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) + +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`, which is required by `Unknown: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others + = note: required for `Unknown` to implement `FromForm<'r>` + = 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 `Unknown: FromFormField<'_>` is not satisfied + --> tests/ui-fail-nightly/from_form_type_errors.rs:7:5 + | +7 | field: Unknown, + | ^^^^^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others + = note: required for `Unknown` to implement `FromForm<'r>` + +error[E0277]: the trait bound `Unknown: FromFormField<'r>` is not satisfied + --> tests/ui-fail-nightly/from_form_type_errors.rs:7:12 + | +7 | field: Unknown, + | ^^^^^^^ the trait `FromFormField<'r>` 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> + Capped> + Capped + Cow<'v, str> + and $N others +note: required by a bound in `FromFieldContext` + --> $WORKSPACE/core/lib/src/form/from_form_field.rs + | + | pub struct FromFieldContext<'v, T: FromFormField<'v>> { + | ^^^^^^^^^^^^^^^^^ required by this bound in `FromFieldContext` + +error[E0277]: the trait bound `Foo: 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`, which is required by `Foo: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others + = note: required for `Foo` to implement `FromForm<'r>` + = 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: FromFormField<'_>` is not satisfied + --> tests/ui-fail-nightly/from_form_type_errors.rs:14:5 + | +14 | field: Foo, + | ^^^^^^^^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `Foo: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others + = note: required for `Foo` to implement `FromForm<'r>` + +error[E0277]: the trait bound `Foo: FromFormField<'r>` is not satisfied + --> tests/ui-fail-nightly/from_form_type_errors.rs:14:12 + | +14 | field: Foo, + | ^^^^^^^^^^ the trait `FromFormField<'r>` is not implemented for `Foo` + | + = help: the following other types implement trait `FromFormField<'v>`: + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> + and $N others +note: required by a bound in `FromFieldContext` + --> $WORKSPACE/core/lib/src/form/from_form_field.rs + | + | pub struct FromFieldContext<'v, T: FromFormField<'v>> { + | ^^^^^^^^^^^^^^^^^ required by this bound in `FromFieldContext` diff --git a/core/codegen/tests/ui-fail-nightly/responder-types.stderr b/core/codegen/tests/ui-fail-nightly/responder-types.stderr index c54893bf..5305106b 100644 --- a/core/codegen/tests/ui-fail-nightly/responder-types.stderr +++ b/core/codegen/tests/ui-fail-nightly/responder-types.stderr @@ -5,34 +5,34 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied | ^^ the trait `Responder<'_, '_>` is not implemented for `u8` | = help: the following other types implement trait `Responder<'r, 'o>`: - > - > - > - > - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as 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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others error[E0277]: the trait bound `Header<'_>: From` is not satisfied --> tests/ui-fail-nightly/responder-types.rs:11:5 | 11 | other: u8, - | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `u8: Into>` | = help: the following other types implement trait `From`: - as From>> - as From> - as From> as From<&Cookie<'_>>> - as From<&Referrer>> as From<&ExpectCt>> - as From<&NoSniff>> + as From<&Frame>> as From<&Hsts>> + as From<&NoSniff>> + as From<&Permission>> + as From<&Prefetch>> + as From<&Referrer>> and $N others = note: required for `u8` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { @@ -45,34 +45,34 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied | ^^ the trait `Responder<'_, '_>` is not implemented for `u8` | = help: the following other types implement trait `Responder<'r, 'o>`: - > - > - > - > - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as 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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others error[E0277]: the trait bound `Header<'_>: From` is not satisfied --> tests/ui-fail-nightly/responder-types.rs:17:5 | 17 | other: u8, - | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `u8: Into>` | = help: the following other types implement trait `From`: - as From>> - as From> - as From> as From<&Cookie<'_>>> - as From<&Referrer>> as From<&ExpectCt>> - as From<&NoSniff>> + as From<&Frame>> as From<&Hsts>> + as From<&NoSniff>> + as From<&Permission>> + as From<&Prefetch>> + as From<&Referrer>> and $N others = note: required for `u8` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { @@ -82,20 +82,20 @@ error[E0277]: the trait bound `Header<'_>: From` is not sat --> tests/ui-fail-nightly/responder-types.rs:24:5 | 24 | then: String, - | ^^^^^^^^^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `std::string::String: Into>` | = help: the following other types implement trait `From`: - as From>> - as From> - as From> as From<&Cookie<'_>>> - as From<&Referrer>> as From<&ExpectCt>> - as From<&NoSniff>> + as From<&Frame>> as From<&Hsts>> + as From<&NoSniff>> + as From<&Permission>> + as From<&Prefetch>> + as From<&Referrer>> and $N others = note: required for `std::string::String` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { @@ -110,16 +110,16 @@ 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>`: - > - > - > - > - as Responder<'r, 'o>> - as Responder<'r, 'static>> - as Responder<'r, 'static>> - as 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>> + as Responder<'r, 'o>> + as Responder<'r, 'static>> + as Responder<'r, 'static>> and $N others -note: required by a bound in `route::handler::, Status, (rocket::Data<'o>, Status)>>::from` +note: required by a bound in `route::handler::, Status, (rocket::Data<'o>, Status)>>::from` --> $WORKSPACE/core/lib/src/route/handler.rs | | pub fn from>(req: &'r Request<'_>, responder: R) -> Outcome<'r> { diff --git a/core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.stderr b/core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.stderr index 1b0c39b1..1db470dc 100644 --- a/core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.stderr +++ b/core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.stderr @@ -172,42 +172,38 @@ error: invalid or unknown media type 90 | #[get("/", format = "text//foo")] | ^^^^^^^^^^^ -error: invalid HTTP method for route handlers - --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:95:9 +error: expected key/value `key = value` + --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:95:18 | 95 | #[route(CONNECT, "/")] - | ^^^^^^^ - | - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` + | ^^^ -error: invalid HTTP method +error: invalid or unknown HTTP method --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:98:9 | 98 | #[route(FIX, "/")] | ^^^ | - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL -error: expected identifier, found string literal +error: invalid or unknown HTTP method --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:101:9 | 101 | #[route("hi", "/")] | ^^^^ | - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL -error: expected identifier, found string literal - --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:104:9 +error: expected key/value `key = value` + --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:104:16 | 104 | #[route("GET", "/")] - | ^^^^^ - | - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` + | ^^^ -error: expected identifier, found integer literal +error: expected method ident or string, found integer literal --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:107:9 | 107 | #[route(120, "/")] | ^^^ | - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL diff --git a/core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.stderr b/core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.stderr index a592cc86..2ceb3e8c 100644 --- a/core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.stderr +++ b/core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.stderr @@ -185,6 +185,7 @@ warning: `segment` starts with `<` but does not end with `>` | ^^^^ | = help: perhaps you meant the dynamic parameter ``? + = note: apply `#[suppress(segment_chars)]` before the item to suppress this lint error: unexpected static parameter --> tests/ui-fail-nightly/route-path-bad-syntax.rs:80:20 @@ -224,6 +225,7 @@ warning: `segment` starts with `<` but does not end with `>` | ^^^^^ | = help: perhaps you meant the dynamic parameter ``? + = note: apply `#[suppress(segment_chars)]` before the item to suppress this lint warning: `segment` starts with `<` but does not end with `>` --> tests/ui-fail-nightly/route-path-bad-syntax.rs:99:9 @@ -232,6 +234,7 @@ warning: `segment` starts with `<` but does not end with `>` | ^^^^^^^^ | = help: perhaps you meant the dynamic parameter ``? + = note: apply `#[suppress(segment_chars)]` before the item to suppress this lint warning: `segment` starts with `<` but does not end with `>` --> tests/ui-fail-nightly/route-path-bad-syntax.rs:102:9 @@ -240,3 +243,4 @@ warning: `segment` starts with `<` but does not end with `>` | ^^^^^^^^ | = help: perhaps you meant the dynamic parameter ``? + = note: apply `#[suppress(segment_chars)]` before the item to suppress this lint diff --git a/core/codegen/tests/ui-fail-nightly/route-type-errors.stderr b/core/codegen/tests/ui-fail-nightly/route-type-errors.stderr index 4339650c..d0b25383 100644 --- a/core/codegen/tests/ui-fail-nightly/route-type-errors.stderr +++ b/core/codegen/tests/ui-fail-nightly/route-type-errors.stderr @@ -1,166 +1,166 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:6:12 + --> tests/ui-fail-nightly/route-type-errors.rs:6:13 | -6 | fn f0(foo: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +6 | fn f0(_foo: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'a str + IpAddr + Ipv4Addr + Ipv6Addr + NonZero + NonZero + NonZero + NonZero and $N others error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:9:12 + --> tests/ui-fail-nightly/route-type-errors.rs:9:13 | -9 | fn f1(foo: Q) {} - | ^ the trait `FromSegments<'_>` is not implemented for `Q` +9 | fn f1(_foo: Q) {} + | ^ the trait `FromSegments<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromSegments<'r>`: - as FromSegments<'r>> > - as FromSegments<'r>> >::Error> as FromSegments<'r>> + as FromSegments<'r>> + as FromSegments<'r>> error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:12:12 + --> tests/ui-fail-nightly/route-type-errors.rs:12:13 | -12 | fn f2(foo: Q) {} - | ^ the trait `FromFormField<'_>` is not implemented for `Q` +12 | fn f2(_foo: Q) {} + | ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>` | = help: the following other types implement trait `FromFormField<'v>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> and $N others = 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 + --> tests/ui-fail-nightly/route-type-errors.rs:15:13 | -15 | fn f3(foo: Q) {} - | ^ the trait `FromFormField<'_>` is not implemented for `Q` +15 | fn f3(_foo: Q) {} + | ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>` | = help: the following other types implement trait `FromFormField<'v>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'v [u8] + &'v str + Capped<&'v [u8]> + Capped<&'v str> + Capped> + Capped> + Capped + Cow<'v, str> and $N others = 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 + --> tests/ui-fail-nightly/route-type-errors.rs:18:13 | -18 | fn f4(foo: Q) {} - | ^ the trait `FromData<'_>` is not implemented for `Q` +18 | fn f4(_foo: Q) {} + | ^ the trait `FromData<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromData<'r>`: - rocket::Data<'r> - Cow<'_, str> - Capped> - Capped> - Capped> - Capped - Capped<&'r str> + &'r RawStr + &'r [u8] + &'r str Capped<&'r RawStr> + Capped<&'r [u8]> + Capped<&'r str> + Capped> + Capped> and $N others error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:21:10 + --> tests/ui-fail-nightly/route-type-errors.rs:21:11 | -21 | fn f5(a: Q, foo: Q) {} - | ^ the trait `FromRequest<'_>` is not implemented for `Q` +21 | fn f5(_a: Q, _foo: Q) {} + | ^ the trait `FromRequest<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromRequest<'r>`: - rocket::http::Method - Outcome>::Error), Status> - Flash<&'r rocket::http::CookieJar<'r>> - rocket::Shutdown - IpAddr - std::net::SocketAddr - std::option::Option - Result>::Error> + &'r Accept + &'r ContentType + &'r CookieJar<'r> + &'r Endpoint + &'r Host<'r> + &'r Limits + &'r Route + &'r rocket::Config and $N others error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:21:18 + --> tests/ui-fail-nightly/route-type-errors.rs:21:20 | -21 | fn f5(a: Q, foo: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +21 | fn f5(_a: Q, _foo: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'a str + IpAddr + Ipv4Addr + Ipv6Addr + NonZero + NonZero + NonZero + NonZero and $N others error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:24:10 + --> tests/ui-fail-nightly/route-type-errors.rs:24:11 | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromRequest<'_>` is not implemented for `Q` +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromRequest<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromRequest<'r>`: - rocket::http::Method - Outcome>::Error), Status> - Flash<&'r rocket::http::CookieJar<'r>> - rocket::Shutdown + &'r Accept + &'r ContentType + &'r CookieJar<'r> + &'r Endpoint + &'r Host<'r> + &'r Limits + &'r Route + &'r rocket::Config + and $N others + +error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied + --> tests/ui-fail-nightly/route-type-errors.rs:24:20 + | +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` + | + = help: the following other types implement trait `FromParam<'a>`: + &'a str IpAddr - std::net::SocketAddr - std::option::Option - Result>::Error> + Ipv4Addr + Ipv6Addr + NonZero + NonZero + NonZero + NonZero and $N others error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:24:18 + --> tests/ui-fail-nightly/route-type-errors.rs:24:43 | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize - and $N others - -error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-nightly/route-type-errors.rs:24:39 - | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` - | - = help: the following other types implement trait `FromParam<'a>`: - bool - isize - i8 - i16 - i32 - i64 - i128 - usize + &'a str + IpAddr + Ipv4Addr + Ipv6Addr + NonZero + NonZero + NonZero + NonZero and $N others diff --git a/core/codegen/tests/ui-fail-nightly/route-warnings.stderr b/core/codegen/tests/ui-fail-nightly/route-warnings.stderr index ba8e4657..d1b0b8cf 100644 --- a/core/codegen/tests/ui-fail-nightly/route-warnings.stderr +++ b/core/codegen/tests/ui-fail-nightly/route-warnings.stderr @@ -1,49 +1,47 @@ -warning: 'application/x-custom' is not a known media type +warning: 'application/x-custom' is not a known format or media type --> tests/ui-fail-nightly/route-warnings.rs:7:21 | 7 | #[get("/", format = "application/x-custom")] | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: apply `#[suppress(unknown_format)]` before the item to suppress this lint -warning: 'x-custom/plain' is not a known media type +warning: 'x-custom/plain' is not a known format or media type --> tests/ui-fail-nightly/route-warnings.rs:10:21 | 10 | #[get("/", format = "x-custom/plain")] | ^^^^^^^^^^^^^^^^ + | + = note: apply `#[suppress(unknown_format)]` before the item to suppress this lint -warning: 'x-custom/x-custom' is not a known media type +warning: 'x-custom/x-custom' is not a known format or media type --> tests/ui-fail-nightly/route-warnings.rs:13:21 | 13 | #[get("/", format = "x-custom/x-custom")] | ^^^^^^^^^^^^^^^^^^^ + | + = note: apply `#[suppress(unknown_format)]` before the item to suppress this lint warning: `data` used with non-payload-supporting method - --> tests/ui-fail-nightly/route-warnings.rs:18:12 + --> tests/ui-fail-nightly/route-warnings.rs:22:12 | -18 | #[get("/", data = "<_foo>")] +22 | #[get("/", data = "<_foo>")] | ^^^^^^^^^^^^^^^ | -note: 'GET' does not typically support payloads - --> tests/ui-fail-nightly/route-warnings.rs:18:3 - | -18 | #[get("/", data = "<_foo>")] - | ^^^ - = note: this warning originates in the attribute macro `get` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: 'GET' does not typically support payloads + = note: apply `#[suppress(dubious_payload)]` before the item to suppress this lint warning: `data` used with non-payload-supporting method - --> tests/ui-fail-nightly/route-warnings.rs:21:13 + --> tests/ui-fail-nightly/route-warnings.rs:25:13 | -21 | #[head("/", data = "<_foo>")] +25 | #[head("/", data = "<_foo>")] | ^^^^^^^^^^^^^^^ | -note: 'HEAD' does not typically support payloads - --> tests/ui-fail-nightly/route-warnings.rs:21:3 - | -21 | #[head("/", data = "<_foo>")] - | ^^^^ - = note: this warning originates in the attribute macro `head` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: 'HEAD' does not typically support payloads + = note: apply `#[suppress(dubious_payload)]` before the item to suppress this lint error: checking for warnings! - --> tests/ui-fail-nightly/route-warnings.rs:25:5 + --> tests/ui-fail-nightly/route-warnings.rs:33:5 | -25 | compile_error!("checking for warnings!") +33 | compile_error!("checking for warnings!") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr b/core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr index c54e50fd..228beed6 100644 --- a/core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr +++ b/core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr @@ -1,208 +1,245 @@ error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:24:37 | -22 | fn optionals(id: Option, name: Result) { } +24 | fn optionals(id: Option, name: Result) { } | ^^^^^^^^^^^^^^^^^^^^ expected `Empty`, found `&str` -error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:22:37 - | -22 | fn optionals(id: Option, name: Result) { } - | ^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `Empty` - error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:45:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -45 | uri!(simple(id = "hi")); - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +47 | uri!(simple(id = "hi")); + | ----------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:47:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -47 | uri!(simple("hello")); - | ^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +49 | uri!(simple("hello")); + | --------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:49:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -49 | uri!(simple(id = 239239i64)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +51 | uri!(simple(id = 239239i64)); + | ---------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:51:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:18:35 | -51 | uri!(not_uri_display(10, S)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `S` +18 | fn not_uri_display(id: i32, name: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +53 | uri!(not_uri_display(10, S)); + | ---------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket_uri_macro_not_uri_display` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:51:30 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:53:30 | -51 | uri!(not_uri_display(10, S)); +53 | uri!(not_uri_display(10, S)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `i32: FromUriParam>` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:56:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:24:18 | -56 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32` +24 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32`, which is required by `std::option::Option: FromUriParam` +... +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ------------------------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > > > + > = note: required for `std::option::Option` to implement `FromUriParam>` + = note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::string::String: FromUriParam>` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:56:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:24:37 | -56 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `std::string::String` +24 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `std::string::String`, which is required by `Result: FromUriParam` +... +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ------------------------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > - > > > > + > + > + > = note: required for `Result` to implement `FromUriParam>` + = note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:58:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:38:17 | -58 | uri!(simple_q("hi")); - | ^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `isize` +38 | fn simple_q(id: isize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `isize` +... +60 | uri!(simple_q("hi")); + | -------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > > > + > + = note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:60:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:38:17 | -60 | uri!(simple_q(id = "hi")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `isize` +38 | fn simple_q(id: isize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `isize` +... +62 | uri!(simple_q(id = "hi")); + | ------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > > > + > + = note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:62:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:41:29 | -62 | uri!(other_q(100, S)); - | ^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `S` +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +64 | uri!(other_q(100, S)); + | --------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:62:23 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:64:23 | -62 | uri!(other_q(100, S)); +64 | uri!(other_q(100, S)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:64:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:41:29 | -64 | uri!(other_q(rest = S, id = 100)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `S` +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +66 | uri!(other_q(rest = S, id = 100)); + | --------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:64:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:66:25 | -64 | uri!(other_q(rest = S, id = 100)); +66 | uri!(other_q(rest = S, id = 100)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: Ignorable` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:66:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:68:25 | -66 | uri!(other_q(rest = _, id = 100)); +68 | uri!(other_q(rest = _, id = 100)); | ^ the trait `Ignorable` is not implemented for `S` | = help: the following other types implement trait `Ignorable

`: - std::option::Option Result + std::option::Option note: required by a bound in `assert_ignorable` --> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs | @@ -210,14 +247,14 @@ note: required by a bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable` error[E0277]: the trait bound `usize: Ignorable` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:68:33 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:70:33 | -68 | uri!(other_q(rest = S, id = _)); +70 | uri!(other_q(rest = S, id = _)); | ^ the trait `Ignorable` is not implemented for `usize` | = help: the following other types implement trait `Ignorable

`: - std::option::Option Result + std::option::Option note: required by a bound in `assert_ignorable` --> $WORKSPACE/core/http/src/uri/fmt/uri_display.rs | @@ -225,62 +262,71 @@ note: required by a bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable` error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:68:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:41:29 | -68 | uri!(other_q(rest = S, id = _)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `S` +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +70 | uri!(other_q(rest = S, id = _)); + | ------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:68:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:70:25 | -68 | uri!(other_q(rest = S, id = _)); +70 | uri!(other_q(rest = S, id = _)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: - > - > - > - > - > - > - > - > + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a [u8] as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> + <&'a std::path::Path as FromUriParam> and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:77:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -77 | uri!(uri!("?foo#bar"), simple(id = "hi")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); + | ----------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:77:15 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:79:15 | -77 | uri!(uri!("?foo#bar"), simple(id = "hi")); +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); | -----^^^^^^^^^^- | | | | | the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Reference<'_>` | required by a bound introduced by this call | = help: the following other types implement trait `ValidRoutePrefix`: - rocket::http::uri::Origin<'a> rocket::http::uri::Absolute<'a> + rocket::http::uri::Origin<'a> note: required by a bound in `RouteUriBuilder::with_prefix` --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs | @@ -288,28 +334,32 @@ note: required by a bound in `RouteUriBuilder::with_prefix` | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:78:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -78 | uri!(uri!("*"), simple(id = "hi")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +80 | uri!(uri!("*"), simple(id = "hi")); + | ---------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:78:15 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:80:15 | -78 | uri!(uri!("*"), simple(id = "hi")); +80 | uri!(uri!("*"), simple(id = "hi")); | -----^^^- | | | | | the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Asterisk` | required by a bound introduced by this call | = help: the following other types implement trait `ValidRoutePrefix`: - rocket::http::uri::Origin<'a> rocket::http::uri::Absolute<'a> + rocket::http::uri::Origin<'a> note: required by a bound in `RouteUriBuilder::with_prefix` --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs | @@ -317,30 +367,34 @@ note: required by a bound in `RouteUriBuilder::with_prefix` | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:81:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -81 | uri!(_, simple(id = "hi"), uri!("*")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +83 | uri!(_, simple(id = "hi"), uri!("*")); + | ------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix>` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:81:37 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:83:37 | -81 | uri!(_, simple(id = "hi"), uri!("*")); +83 | uri!(_, simple(id = "hi"), uri!("*")); | -----^^^- | | | | | the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Asterisk` | required by a bound introduced by this call | = help: the following other types implement trait `ValidRouteSuffix`: - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> note: required by a bound in `RouteUriBuilder::with_suffix` --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs | @@ -350,30 +404,34 @@ note: required by a bound in `RouteUriBuilder::with_suffix` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:82:5 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:15:15 | -82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); + | -------------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix>` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:82:37 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:84:37 | -82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); | -----^^^^^^^^^^- | | | | | the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Origin<'_>` | required by a bound introduced by this call | = help: the following other types implement trait `ValidRouteSuffix`: - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> note: required by a bound in `RouteUriBuilder::with_suffix` --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs | @@ -383,112 +441,122 @@ note: required by a bound in `RouteUriBuilder::with_suffix` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:45:22 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:47:22 | -45 | uri!(simple(id = "hi")); +47 | uri!(simple(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:47:17 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:49:17 | -47 | uri!(simple("hello")); +49 | uri!(simple("hello")); | ^^^^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:49:22 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:51:22 | -49 | uri!(simple(id = 239239i64)); +51 | uri!(simple(id = 239239i64)); | ^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `i32: FromUriParam>` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:56:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:58:25 | -56 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); - | ^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32` +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32`, which is required by `std::option::Option: FromUriParam>` | = help: the following other types implement trait `FromUriParam`: - > > > + > = note: required for `std::option::Option` to implement `FromUriParam>` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:58:19 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:60:19 | -58 | uri!(simple_q("hi")); +60 | uri!(simple_q("hi")); | ^^^^ the trait `FromUriParam` is not implemented for `isize` | = help: the following other types implement trait `FromUriParam`: - > > > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:60:24 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:62:24 | -60 | uri!(simple_q(id = "hi")); +62 | uri!(simple_q(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `isize` | = help: the following other types implement trait `FromUriParam`: - > > > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:77:40 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:79:40 | -77 | uri!(uri!("?foo#bar"), simple(id = "hi")); +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:78:33 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:80:33 | -78 | uri!(uri!("*"), simple(id = "hi")); +80 | uri!(uri!("*"), simple(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:81:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:83:25 | -81 | uri!(_, simple(id = "hi"), uri!("*")); +83 | uri!(_, simple(id = "hi"), uri!("*")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-nightly/typed-uri-bad-type.rs:82:25 + --> tests/ui-fail-nightly/typed-uri-bad-type.rs:84:25 | -82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: - > - > > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.stderr b/core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.stderr index 536db778..337b34ed 100644 --- a/core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.stderr +++ b/core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.stderr @@ -1,294 +1,288 @@ error: expected identifier, found keyword `_` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:63:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:65:18 | -63 | uri!(ignored(_ = 10)); +65 | uri!(ignored(_ = 10)); | ^ error: route expects 1 parameter but 2 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:69:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:71:18 | -69 | uri!(ignored(10, "10")); +71 | uri!(ignored(10, "10")); | ^^^^^^^^ | = note: route `ignored` has uri "/<_>" error: expected unnamed arguments due to ignored parameters - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:67:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:69:18 | -67 | uri!(ignored(num = 10)); +69 | uri!(ignored(num = 10)); | ^^^^^^^^ | - = note: uri for route `ignored` ignores path parameters: "/<_>" + = note: uri for route `ignored` ignores 1 path parameters: "/<_>" error: route expects 1 parameter but 2 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:65:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:67:18 | -65 | uri!(ignored(10, 20)); +67 | uri!(ignored(10, 20)); | ^^^^^^ | = note: route `ignored` has uri "/<_>" error: path parameters cannot be ignored - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:61:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:63:18 | -61 | uri!(ignored(_)); +63 | uri!(ignored(_)); | ^ error: path parameters cannot be ignored - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:59:36 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:61:36 | -59 | uri!(optionals(id = 10, name = _)); +61 | uri!(optionals(id = 10, name = _)); | ^ error: path parameters cannot be ignored - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:57:25 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:59:25 | -57 | uri!(optionals(id = _, name = "bob".into())); +59 | uri!(optionals(id = _, name = "bob".into())); | ^ error: invalid parameters for `has_two` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:55:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:57:18 | -55 | uri!(has_two(id = 100, cookies = "hi")); +57 | uri!(has_two(id = 100, cookies = "hi")); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32, name: String = help: missing parameter: `name` help: unknown parameter: `cookies` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:55:28 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:57:28 | -55 | uri!(has_two(id = 100, cookies = "hi")); +57 | uri!(has_two(id = 100, cookies = "hi")); | ^^^^^^^ error: invalid parameters for `has_two` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:53:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:55:18 | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32, name: String = help: missing parameter: `name` help: unknown parameter: `cookies` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:53:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:55:18 | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); | ^^^^^^^ help: duplicate parameter: `id` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:53:44 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:55:44 | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); | ^^ ^^ error: invalid parameters for `has_two` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:51:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:53:18 | -51 | uri!(has_two(name = "hi")); +53 | uri!(has_two(name = "hi")); | ^^^^^^^^^^^ | = note: uri parameters are: id: i32, name: String = help: missing parameter: `id` error: invalid parameters for `has_two` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:49:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:51:18 | -49 | uri!(has_two(id = 100, id = 100, )); +51 | uri!(has_two(id = 100, id = 100, )); | ^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32, name: String = help: missing parameter: `name` help: duplicate parameter: `id` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:49:28 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:51:28 | -49 | uri!(has_two(id = 100, id = 100, )); +51 | uri!(has_two(id = 100, id = 100, )); | ^^ +error: invalid parameters for `has_one_guarded` route uri + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:49:26 + | +49 | uri!(has_one_guarded(id = 100, cookies = "hi")); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: uri parameters are: id: i32 +help: unknown parameter: `cookies` + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:49:36 + | +49 | uri!(has_one_guarded(id = 100, cookies = "hi")); + | ^^^^^^^ + error: invalid parameters for `has_one_guarded` route uri --> tests/ui-fail-nightly/typed-uris-bad-params.rs:47:26 | -47 | uri!(has_one_guarded(id = 100, cookies = "hi")); +47 | uri!(has_one_guarded(cookies = "hi", id = 100)); | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: unknown parameter: `cookies` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:47:36 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:47:26 | -47 | uri!(has_one_guarded(id = 100, cookies = "hi")); - | ^^^^^^^ - -error: invalid parameters for `has_one_guarded` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:45:26 - | -45 | uri!(has_one_guarded(cookies = "hi", id = 100)); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: uri parameters are: id: i32 -help: unknown parameter: `cookies` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:45:26 - | -45 | uri!(has_one_guarded(cookies = "hi", id = 100)); +47 | uri!(has_one_guarded(cookies = "hi", id = 100)); | ^^^^^^^ error: invalid parameters for `has_one` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:43:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:45:18 | -43 | uri!(has_one(name = "hi")); +45 | uri!(has_one(name = "hi")); | ^^^^^^^^^^^ | = note: uri parameters are: id: i32 = help: missing parameter: `id` help: unknown parameter: `name` + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:45:18 + | +45 | uri!(has_one(name = "hi")); + | ^^^^ + +error: invalid parameters for `has_one` route uri --> tests/ui-fail-nightly/typed-uris-bad-params.rs:43:18 | -43 | uri!(has_one(name = "hi")); - | ^^^^ +43 | uri!(has_one(id = 100, id = 100, )); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: uri parameters are: id: i32 +help: duplicate parameter: `id` + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:43:28 + | +43 | uri!(has_one(id = 100, id = 100, )); + | ^^ error: invalid parameters for `has_one` route uri --> tests/ui-fail-nightly/typed-uris-bad-params.rs:41:18 | -41 | uri!(has_one(id = 100, id = 100, )); - | ^^^^^^^^^^^^^^^^^^^ +41 | uri!(has_one(id = 100, id = 100)); + | ^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: duplicate parameter: `id` --> tests/ui-fail-nightly/typed-uris-bad-params.rs:41:28 | -41 | uri!(has_one(id = 100, id = 100, )); +41 | uri!(has_one(id = 100, id = 100)); | ^^ error: invalid parameters for `has_one` route uri --> tests/ui-fail-nightly/typed-uris-bad-params.rs:39:18 | -39 | uri!(has_one(id = 100, id = 100)); - | ^^^^^^^^^^^^^^^^^^ - | - = note: uri parameters are: id: i32 -help: duplicate parameter: `id` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:39:28 - | -39 | uri!(has_one(id = 100, id = 100)); - | ^^ - -error: invalid parameters for `has_one` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:37:18 - | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: unknown parameters: `name`, `age` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:37:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:39:18 | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); | ^^^^ ^^^ help: duplicate parameter: `id` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:37:50 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:39:50 | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); | ^^ error: invalid parameters for `has_one` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:35:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:37:18 | -35 | uri!(has_one(name = 100, age = 50, id = 100)); +37 | uri!(has_one(name = 100, age = 50, id = 100)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: unknown parameters: `name`, `age` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:35:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:37:18 | -35 | uri!(has_one(name = 100, age = 50, id = 100)); +37 | uri!(has_one(name = 100, age = 50, id = 100)); | ^^^^ ^^^ error: invalid parameters for `has_one` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:33:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:35:18 | -33 | uri!(has_one(name = 100, id = 100)); +35 | uri!(has_one(name = 100, id = 100)); | ^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: unknown parameter: `name` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:33:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:35:18 | -33 | uri!(has_one(name = 100, id = 100)); +35 | uri!(has_one(name = 100, id = 100)); | ^^^^ error: invalid parameters for `has_one` route uri - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:31:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:33:18 | -31 | uri!(has_one(id = 100, name = "hi")); +33 | uri!(has_one(id = 100, name = "hi")); | ^^^^^^^^^^^^^^^^^^^^^ | = note: uri parameters are: id: i32 help: unknown parameter: `name` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:31:28 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:33:28 | -31 | uri!(has_one(id = 100, name = "hi")); +33 | uri!(has_one(id = 100, name = "hi")); | ^^^^ error: route expects 2 parameters but 1 was supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:29:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:31:18 | -29 | uri!(has_two(10)); +31 | uri!(has_two(10)); | ^^ | = note: route `has_two` has uri "/?" error: route expects 2 parameters but 3 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:28:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:30:18 | -28 | uri!(has_two(10, "hi", "there")); +30 | uri!(has_two(10, "hi", "there")); | ^^^^^^^^^^^^^^^^^ | = note: route `has_two` has uri "/?" error: route expects 1 parameter but 2 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:26:26 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:28:26 | -26 | uri!(has_one_guarded("hi", 100)); +28 | uri!(has_one_guarded("hi", 100)); | ^^^^^^^^^ | = note: route `has_one_guarded` has uri "/" error: route expects 1 parameter but 2 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:25:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:27:18 | -25 | uri!(has_one("Hello", 23, )); +27 | uri!(has_one("Hello", 23, )); | ^^^^^^^^^^^^ | = note: route `has_one` has uri "/" error: route expects 1 parameter but 2 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:24:18 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:26:18 | -24 | uri!(has_one(1, 23)); +26 | uri!(has_one(1, 23)); | ^^^^^ | = note: route `has_one` has uri "/" error: route expects 1 parameter but 0 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:22:10 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:24:10 | -22 | uri!(has_one()); +24 | uri!(has_one()); | ^^^^^^^ | = note: route `has_one` has uri "/" error: route expects 1 parameter but 0 were supplied - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:21:10 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:23:10 | -21 | uri!(has_one); +23 | uri!(has_one); | ^^^^^^^ | = note: route `has_one` has uri "/" error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:15:37 + --> tests/ui-fail-nightly/typed-uris-bad-params.rs:17:37 | -15 | fn optionals(id: Option, name: Result) { } +17 | fn optionals(id: Option, name: Result) { } | ^^^^^^^^^^^^^^^^^^^^ expected `Empty`, found `&str` - -error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-nightly/typed-uris-bad-params.rs:15:37 - | -15 | fn optionals(id: Option, name: Result) { } - | ^^^^^^^^^^^^^^^^^^^^ expected `&str`, found `Empty` diff --git a/core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.stderr b/core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.stderr index f7ae1881..8a166965 100644 --- a/core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.stderr +++ b/core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.stderr @@ -150,4 +150,4 @@ error: route expects 2 parameters but 0 were supplied 13 | uri!(simple,); | ^^^^^^ | - = note: route `simple` has uri "//" + = note: route `simple` has uri "/<_id>/<_name>" diff --git a/core/codegen/tests/ui-fail-nightly/uri_display_type_errors.stderr b/core/codegen/tests/ui-fail-nightly/uri_display_type_errors.stderr index fb9c3789..a4cb38dd 100644 --- a/core/codegen/tests/ui-fail-nightly/uri_display_type_errors.stderr +++ b/core/codegen/tests/ui-fail-nightly/uri_display_type_errors.stderr @@ -2,17 +2,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:6:13 | 6 | struct Bar1(BadType); - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` @@ -25,17 +25,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:10:5 | 10 | field: BadType, - | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` @@ -48,17 +48,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:16:5 | 16 | bad: BadType, - | ^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'_, rocket::http::uri::fmt::Query>::write_named_value` @@ -71,17 +71,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:21:11 | 21 | Inner(BadType), - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` = note: 1 redundant requirement hidden @@ -96,17 +96,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:27:9 | 27 | field: BadType, - | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` = note: 1 redundant requirement hidden @@ -121,17 +121,17 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-nightly/uri_display_type_errors.rs:35:9 | 35 | other: BadType, - | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` = note: 1 redundant requirement hidden @@ -146,17 +146,17 @@ error[E0277]: the trait bound `BadType: UriDisplay --> tests/ui-fail-nightly/uri_display_type_errors.rs:40:12 | 40 | struct Baz(BadType); - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: - > - > - > - > - > - > - > - > + <&T as UriDisplay

> + <&mut T as UriDisplay

> + as UriDisplay> + > + > + > + > + > and $N others = note: required for `&BadType` to implement `UriDisplay` note: required by a bound in `rocket::http::uri::fmt::Formatter::<'i, P>::write_value` diff --git a/core/codegen/tests/ui-fail-stable/async-entry.stderr b/core/codegen/tests/ui-fail-stable/async-entry.stderr index b300d054..d955ada5 100644 --- a/core/codegen/tests/ui-fail-stable/async-entry.stderr +++ b/core/codegen/tests/ui-fail-stable/async-entry.stderr @@ -10,7 +10,7 @@ error: [note] this function must be `async` --> tests/ui-fail-stable/async-entry.rs:5:5 | 5 | fn foo() { } - | ^^ + | ^^^^^^^^ error: attribute can only be applied to `async` functions --> tests/ui-fail-stable/async-entry.rs:16:5 @@ -24,7 +24,7 @@ error: [note] this function must be `async` --> tests/ui-fail-stable/async-entry.rs:17:5 | 17 | fn main() { - | ^^ + | ^^^^^^^^^ error: attribute cannot be applied to `main` function = note: this attribute generates a `main` function @@ -53,7 +53,7 @@ error: [note] this function must return a value --> tests/ui-fail-stable/async-entry.rs:57:5 | 57 | async fn rocket() { - | ^^^^^ + | ^^^^^^^^^^^^^^^^^ error: attribute can only be applied to functions that return a value --> tests/ui-fail-stable/async-entry.rs:64:5 @@ -67,7 +67,7 @@ error: [note] this function must return a value --> tests/ui-fail-stable/async-entry.rs:65:5 | 65 | fn rocket() { - | ^^ + | ^^^^^^^^^^^ error: attribute cannot be applied to `main` function = note: this attribute generates a `main` function @@ -143,10 +143,9 @@ error[E0308]: mismatched types --> tests/ui-fail-stable/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: `;` diff --git a/core/codegen/tests/ui-fail-stable/bad-ignored-segments.stderr b/core/codegen/tests/ui-fail-stable/bad-ignored-segments.stderr index efb913cf..6b24a1c1 100644 --- a/core/codegen/tests/ui-fail-stable/bad-ignored-segments.stderr +++ b/core/codegen/tests/ui-fail-stable/bad-ignored-segments.stderr @@ -1,13 +1,13 @@ error: parameter must be named = help: use a name such as `_guard` or `_param` - --> tests/ui-fail-stable/bad-ignored-segments.rs:6:7 + --> tests/ui-fail-stable/bad-ignored-segments.rs:6:12 | 6 | #[get("/c?<_>")] - | ^^^^^^^^ + | ^ error: parameter must be named = help: use a name such as `_guard` or `_param` - --> tests/ui-fail-stable/bad-ignored-segments.rs:9:21 + --> tests/ui-fail-stable/bad-ignored-segments.rs:9:22 | 9 | #[post("/d", data = "<_>")] - | ^^^^^ + | ^^^ diff --git a/core/codegen/tests/ui-fail-stable/catch.stderr b/core/codegen/tests/ui-fail-stable/catch.stderr index fdb47184..16416920 100644 --- a/core/codegen/tests/ui-fail-stable/catch.stderr +++ b/core/codegen/tests/ui-fail-stable/catch.stderr @@ -24,14 +24,14 @@ error: unexpected keyed parameter: expected literal or identifier --> tests/ui-fail-stable/catch.rs:14:9 | 14 | #[catch(code = "404")] - | ^^^^ + | ^^^^^^^^^^^^ error: unexpected keyed parameter: expected literal or identifier = help: `#[catch]` expects a status code int or `default`: `#[catch(404)]` or `#[catch(default)]` --> tests/ui-fail-stable/catch.rs:17:9 | 17 | #[catch(code = 404)] - | ^^^^ + | ^^^^^^^^^^ error: status must be in range [100, 599] = help: `#[catch]` expects a status code int or `default`: `#[catch(404)]` or `#[catch(default)]` @@ -52,21 +52,21 @@ error: unexpected attribute parameter: `message` --> tests/ui-fail-stable/catch.rs:26:14 | 26 | #[catch(400, message = "foo")] - | ^^^^^^^ + | ^^^^^^^^^^^^^^^ error[E0308]: arguments to this function are incorrect --> tests/ui-fail-stable/catch.rs:30:4 | -30 | fn f3(_request: &Request, other: bool) { } - | ^^ - ---- an argument of type `bool` is missing +30 | fn f3(_request: &Request, _other: bool) { } + | ^^ -------- ---- an argument of type `bool` is missing | | | unexpected argument of type `Status` | note: function defined here --> tests/ui-fail-stable/catch.rs:30:4 | -30 | fn f3(_request: &Request, other: bool) { } - | ^^ ------------------ ----------- +30 | fn f3(_request: &Request, _other: bool) { } + | ^^ ------------------ ------------ help: provide the argument | 29 | f3(bool, /* bool */) diff --git a/core/codegen/tests/ui-fail-stable/catch_type_errors.stderr b/core/codegen/tests/ui-fail-stable/catch_type_errors.stderr index 9b930dbb..9d718a2f 100644 --- a/core/codegen/tests/ui-fail-stable/catch_type_errors.stderr +++ b/core/codegen/tests/ui-fail-stable/catch_type_errors.stderr @@ -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>`: - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> as Responder<'r, 'o>> > as Responder<'r, 'r>> - > + > and $N others error[E0277]: the trait bound `bool: Responder<'_, '_>` is not satisfied @@ -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>`: - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> as Responder<'r, 'o>> > as Responder<'r, 'r>> - > + > and $N others error[E0308]: mismatched types @@ -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>`: - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> as Responder<'r, 'o>> > as Responder<'r, 'r>> - > + > and $N others error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied @@ -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>`: - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> as Responder<'r, 'o>> > as Responder<'r, 'r>> - > + > and $N others diff --git a/core/codegen/tests/ui-fail-stable/from_form.stderr b/core/codegen/tests/ui-fail-stable/from_form.stderr index 3bc006df..b0d0addf 100644 --- a/core/codegen/tests/ui-fail-stable/from_form.stderr +++ b/core/codegen/tests/ui-fail-stable/from_form.stderr @@ -2,7 +2,7 @@ error: enums are not supported --> tests/ui-fail-stable/from_form.rs:4:1 | 4 | enum Thing { } - | ^^^^ + | ^^^^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:3:10 @@ -16,7 +16,7 @@ error: at least one field is required --> tests/ui-fail-stable/from_form.rs:7:1 | 7 | struct Foo1; - | ^^^^^^ + | ^^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:6:10 @@ -93,13 +93,14 @@ error: [help] declared in this field --> tests/ui-fail-stable/from_form.rs:36:5 | 36 | foo: usize, - | ^^^ + | ^^^^^^^^^^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form.rs:34:5 | -34 | #[field(name = "foo")] - | ^ +34 | / #[field(name = "foo")] +35 | | field: String, + | |_________________^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:32:10 @@ -118,14 +119,16 @@ error: field name conflicts with previous name error: [help] declared in this field --> tests/ui-fail-stable/from_form.rs:43:5 | -43 | #[field(name = "hello")] - | ^ +43 | / #[field(name = "hello")] +44 | | other: String, + | |_________________^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form.rs:41:5 | -41 | #[field(name = "hello")] - | ^ +41 | / #[field(name = "hello")] +42 | | first: String, + | |_________________^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:39:10 @@ -144,14 +147,15 @@ error: field name conflicts with previous name error: [help] declared in this field --> tests/ui-fail-stable/from_form.rs:50:5 | -50 | #[field(name = "first")] - | ^ +50 | / #[field(name = "first")] +51 | | other: String, + | |_________________^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form.rs:49:5 | 49 | first: String, - | ^^^^^ + | ^^^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:47:10 @@ -165,7 +169,7 @@ error: unexpected attribute parameter: `field` --> tests/ui-fail-stable/from_form.rs:56:28 | 56 | #[field(name = "blah", field = "bloo")] - | ^^^^^ + | ^^^^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:54:10 @@ -221,7 +225,7 @@ error: unexpected attribute parameter: `beep` --> tests/ui-fail-stable/from_form.rs:80:13 | 80 | #[field(beep = "bop")] - | ^^^^ + | ^^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:78:10 @@ -234,8 +238,10 @@ error: [note] error occurred while deriving `FromForm` error: field has conflicting names --> tests/ui-fail-stable/from_form.rs:86:5 | -86 | #[field(name = "blah")] - | ^ +86 | / #[field(name = "blah")] +87 | | #[field(name = "blah")] +88 | | my_field: String, + | |____________________^ error: [note] this field name... --> tests/ui-fail-stable/from_form.rs:86:20 @@ -393,7 +399,7 @@ error: duplicate attribute parameter: default --> tests/ui-fail-stable/from_form.rs:177:26 | 177 | #[field(default = 1, default = 2)] - | ^^^^^^^ + | ^^^^^^^^^^^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form.rs:175:10 @@ -553,7 +559,7 @@ error[E0277]: the trait bound `bool: From<&str>` is not satisfied --> tests/ui-fail-stable/from_form.rs:209:23 | 209 | #[field(default = "no conversion")] - | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool` + | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `bool`, which is required by `&str: Into<_>` | = help: the following other types implement trait `From`: > diff --git a/core/codegen/tests/ui-fail-stable/from_form_field.stderr b/core/codegen/tests/ui-fail-stable/from_form_field.stderr index 58910904..9cef1787 100644 --- a/core/codegen/tests/ui-fail-stable/from_form_field.stderr +++ b/core/codegen/tests/ui-fail-stable/from_form_field.stderr @@ -2,7 +2,7 @@ error: tuple structs are not supported --> tests/ui-fail-stable/from_form_field.rs:4:1 | 4 | struct Foo1; - | ^^^^^^ + | ^^^^^^^^^^^^ error: [note] error occurred while deriving `FromFormField` --> tests/ui-fail-stable/from_form_field.rs:3:10 @@ -16,7 +16,7 @@ error: tuple structs are not supported --> tests/ui-fail-stable/from_form_field.rs:7:1 | 7 | struct Foo2(usize); - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ error: [note] error occurred while deriving `FromFormField` --> tests/ui-fail-stable/from_form_field.rs:6:10 @@ -29,8 +29,10 @@ error: [note] error occurred while deriving `FromFormField` error: named structs are not supported --> tests/ui-fail-stable/from_form_field.rs:10:1 | -10 | struct Foo3 { - | ^^^^^^ +10 | / struct Foo3 { +11 | | foo: usize, +12 | | } + | |_^ error: [note] error occurred while deriving `FromFormField` --> tests/ui-fail-stable/from_form_field.rs:9:10 @@ -58,7 +60,7 @@ error: enum must have at least one variant --> tests/ui-fail-stable/from_form_field.rs:20:1 | 20 | enum Foo5 { } - | ^^^^ + | ^^^^^^^^^^^^^ error: [note] error occurred while deriving `FromFormField` --> tests/ui-fail-stable/from_form_field.rs:19:10 @@ -113,8 +115,10 @@ error: [note] error occurred while deriving `FromFormField` error: variant has conflicting values --> tests/ui-fail-stable/from_form_field.rs:41:5 | -41 | #[field(value = "bar")] - | ^ +41 | / #[field(value = "bar")] +42 | | #[field(value = "bar")] +43 | | A, + | |_____^ error: [note] this value... --> tests/ui-fail-stable/from_form_field.rs:41:21 @@ -145,14 +149,16 @@ error: field value conflicts with previous value error: [help] ...declared in this variant --> tests/ui-fail-stable/from_form_field.rs:50:5 | -50 | #[field(value = "BAr")] - | ^ +50 | / #[field(value = "BAr")] +51 | | B, + | |_____^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form_field.rs:48:5 | -48 | #[field(value = "bar")] - | ^ +48 | / #[field(value = "bar")] +49 | | A, + | |_____^ error: [note] error occurred while deriving `FromFormField` --> tests/ui-fail-stable/from_form_field.rs:46:10 @@ -171,8 +177,9 @@ error: field value conflicts with previous value error: [help] ...declared in this variant --> tests/ui-fail-stable/from_form_field.rs:57:5 | -57 | #[field(value = "a")] - | ^ +57 | / #[field(value = "a")] +58 | | B, + | |_____^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form_field.rs:56:5 @@ -191,8 +198,10 @@ error: [note] error occurred while deriving `FromFormField` error: variant has conflicting values --> tests/ui-fail-stable/from_form_field.rs:80:5 | -80 | #[field(value = "FoO")] - | ^ +80 | / #[field(value = "FoO")] +81 | | #[field(value = "foo")] +82 | | A, + | |_____^ error: [note] this value... --> tests/ui-fail-stable/from_form_field.rs:80:21 @@ -217,8 +226,10 @@ error: [note] error occurred while deriving `FromFormField` error: field has conflicting names --> tests/ui-fail-stable/from_form_field.rs:87:5 | -87 | #[field(name = "foo")] - | ^ +87 | / #[field(name = "foo")] +88 | | #[field(name = uncased("FOO"))] +89 | | single: usize, + | |_________________^ error: [note] this field name... --> tests/ui-fail-stable/from_form_field.rs:87:20 @@ -249,14 +260,16 @@ error: field name conflicts with previous name error: [help] declared in this field --> tests/ui-fail-stable/from_form_field.rs:96:5 | -96 | #[field(name = "foo")] - | ^ +96 | / #[field(name = "foo")] +97 | | other: usize, + | |________________^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form_field.rs:94:5 | -94 | #[field(name = "foo")] - | ^ +94 | / #[field(name = "foo")] +95 | | single: usize, + | |_________________^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form_field.rs:92:10 @@ -276,13 +289,14 @@ error: [help] declared in this field --> tests/ui-fail-stable/from_form_field.rs:104:5 | 104 | hello_there: usize, - | ^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form_field.rs:102:5 | -102 | #[field(name = uncased("HELLO_THERE"))] - | ^ +102 | / #[field(name = uncased("HELLO_THERE"))] +103 | | single: usize, + | |_________________^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form_field.rs:100:10 @@ -302,13 +316,14 @@ error: [help] declared in this field --> tests/ui-fail-stable/from_form_field.rs:111:5 | 111 | hello_there: usize, - | ^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: [note] previous field with conflicting name --> tests/ui-fail-stable/from_form_field.rs:109:5 | -109 | #[field(name = "hello_there")] - | ^ +109 | / #[field(name = "hello_there")] +110 | | single: usize, + | |_________________^ error: [note] error occurred while deriving `FromForm` --> tests/ui-fail-stable/from_form_field.rs:107:10 diff --git a/core/codegen/tests/ui-fail-stable/from_form_type_errors.stderr b/core/codegen/tests/ui-fail-stable/from_form_type_errors.stderr index 6022e34c..ad6ebb37 100644 --- a/core/codegen/tests/ui-fail-stable/from_form_type_errors.stderr +++ b/core/codegen/tests/ui-fail-stable/from_form_type_errors.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied --> tests/ui-fail-stable/from_form_type_errors.rs:7:12 | 7 | field: Unknown, - | ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown` + | ^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>` | = help: the following other types implement trait `FromFormField<'v>`: bool @@ -16,11 +16,40 @@ error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied and $N others = note: required for `Unknown` to implement `FromForm<'r>` +error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:5:10 + | +5 | #[derive(FromForm)] + | ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send` + | + = 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-stable/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: FromFormField<'_>` is not satisfied --> tests/ui-fail-stable/from_form_type_errors.rs:14:12 | 14 | field: Foo, - | ^^^ the trait `FromFormField<'_>` is not implemented for `Foo` + | ^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `Foo: FromForm<'r>` | = help: the following other types implement trait `FromFormField<'v>`: bool @@ -33,3 +62,150 @@ error[E0277]: the trait bound `Foo: FromFormField<'_>` is not satisfied usize and $N others = note: required for `Foo` to implement `FromForm<'r>` + +error[E0277]: the trait bound `Foo: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:12:10 + | +12 | #[derive(FromForm)] + | ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `_::FromFormGeneratedContext<'r>: std::marker::Send` + | + = help: the following other types implement trait `FromFormField<'v>`: + bool + isize + i8 + i16 + i32 + i64 + i128 + usize + and $N others + = note: required for `Foo` to implement `FromForm<'r>` +note: required because it appears within the type `_::FromFormGeneratedContext<'r>` + --> tests/ui-fail-stable/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) + +error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:5:10 + | +5 | #[derive(FromForm)] + | ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>` + | + = 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: this error originates in the derive macro `FromForm` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:7:5 + | +7 | field: Unknown, + | ^^^^^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Unknown`, which is required by `Unknown: FromForm<'r>` + | + = 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>` + +error[E0277]: the trait bound `Unknown: FromFormField<'r>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:7:12 + | +7 | field: Unknown, + | ^^^^^^^ the trait `FromFormField<'r>` 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 by a bound in `FromFieldContext` + --> $WORKSPACE/core/lib/src/form/from_form_field.rs + | + | pub struct FromFieldContext<'v, T: FromFormField<'v>> { + | ^^^^^^^^^^^^^^^^^ required by this bound in `FromFieldContext` + +error[E0277]: the trait bound `Foo: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:12:10 + | +12 | #[derive(FromForm)] + | ^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `Foo: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + bool + isize + i8 + i16 + i32 + i64 + i128 + usize + and $N others + = note: required for `Foo` to implement `FromForm<'r>` + = 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: FromFormField<'_>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:14:5 + | +14 | field: Foo, + | ^^^^^^^^^^^^^^^^^ the trait `FromFormField<'_>` is not implemented for `Foo`, which is required by `Foo: FromForm<'r>` + | + = help: the following other types implement trait `FromFormField<'v>`: + bool + isize + i8 + i16 + i32 + i64 + i128 + usize + and $N others + = note: required for `Foo` to implement `FromForm<'r>` + +error[E0277]: the trait bound `Foo: FromFormField<'r>` is not satisfied + --> tests/ui-fail-stable/from_form_type_errors.rs:14:12 + | +14 | field: Foo, + | ^^^^^^^^^^ the trait `FromFormField<'r>` is not implemented for `Foo` + | + = help: the following other types implement trait `FromFormField<'v>`: + bool + isize + i8 + i16 + i32 + i64 + i128 + usize + and $N others +note: required by a bound in `FromFieldContext` + --> $WORKSPACE/core/lib/src/form/from_form_field.rs + | + | pub struct FromFieldContext<'v, T: FromFormField<'v>> { + | ^^^^^^^^^^^^^^^^^ required by this bound in `FromFieldContext` diff --git a/core/codegen/tests/ui-fail-stable/responder-types.stderr b/core/codegen/tests/ui-fail-stable/responder-types.stderr index 2526127e..bce840f4 100644 --- a/core/codegen/tests/ui-fail-stable/responder-types.stderr +++ b/core/codegen/tests/ui-fail-stable/responder-types.stderr @@ -1,30 +1,30 @@ error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied - --> tests/ui-fail-stable/responder-types.rs:5:5 + --> tests/ui-fail-stable/responder-types.rs:5:12 | 5 | thing: u8, - | ^^^^^ the trait `Responder<'_, '_>` is not implemented for `u8` + | ^^ the trait `Responder<'_, '_>` is not implemented for `u8` | = help: the following other types implement trait `Responder<'r, 'o>`: > > > > - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> and $N others error[E0277]: the trait bound `Header<'_>: From` is not satisfied --> tests/ui-fail-stable/responder-types.rs:11:5 | 11 | other: u8, - | ^^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `u8: Into>` | = help: the following other types implement trait `From`: as From>> as From> - as From> + as From> as From<&Cookie<'_>>> as From<&Referrer>> as From<&ExpectCt>> @@ -32,39 +32,39 @@ error[E0277]: the trait bound `Header<'_>: From` is not satisfied as From<&Hsts>> and $N others = note: required for `u8` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { | ^^^^^^^^^^^^^^^^ required by this bound in `Response::<'r>::set_header` error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied - --> tests/ui-fail-stable/responder-types.rs:16:5 + --> tests/ui-fail-stable/responder-types.rs:16:12 | 16 | thing: u8, - | ^^^^^ the trait `Responder<'_, '_>` is not implemented for `u8` + | ^^ the trait `Responder<'_, '_>` is not implemented for `u8` | = help: the following other types implement trait `Responder<'r, 'o>`: > > > > - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> and $N others error[E0277]: the trait bound `Header<'_>: From` is not satisfied --> tests/ui-fail-stable/responder-types.rs:17:5 | 17 | other: u8, - | ^^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `u8: Into>` | = help: the following other types implement trait `From`: as From>> as From> - as From> + as From> as From<&Cookie<'_>>> as From<&Referrer>> as From<&ExpectCt>> @@ -72,7 +72,7 @@ error[E0277]: the trait bound `Header<'_>: From` is not satisfied as From<&Hsts>> and $N others = note: required for `u8` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { @@ -82,12 +82,12 @@ error[E0277]: the trait bound `Header<'_>: From` is not sat --> tests/ui-fail-stable/responder-types.rs:24:5 | 24 | then: String, - | ^^^^ the trait `From` is not implemented for `Header<'_>` + | ^^^^^^^^^^^^ the trait `From` is not implemented for `Header<'_>`, which is required by `std::string::String: Into>` | = help: the following other types implement trait `From`: as From>> as From> - as From> + as From> as From<&Cookie<'_>>> as From<&Referrer>> as From<&ExpectCt>> @@ -95,7 +95,7 @@ error[E0277]: the trait bound `Header<'_>: From` is not sat as From<&Hsts>> and $N others = note: required for `std::string::String` to implement `Into>` -note: required by a bound in `rocket::Response::<'r>::set_header` +note: required by a bound in `Response::<'r>::set_header` --> $WORKSPACE/core/lib/src/response/response.rs | | pub fn set_header<'h: 'r, H: Into>>(&mut self, header: H) -> bool { @@ -114,12 +114,12 @@ error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied > > > - as Responder<'r, 'o>> as Responder<'r, 'static>> as Responder<'r, 'static>> as Responder<'r, 'o>> + as Responder<'r, 'o>> and $N others -note: required by a bound in `route::handler::, Status, (rocket::Data<'o>, Status)>>::from` +note: required by a bound in `route::handler::, Status, (rocket::Data<'o>, Status)>>::from` --> $WORKSPACE/core/lib/src/route/handler.rs | | pub fn from>(req: &'r Request<'_>, responder: R) -> Outcome<'r> { diff --git a/core/codegen/tests/ui-fail-stable/responder.stderr b/core/codegen/tests/ui-fail-stable/responder.stderr index 2f03d170..c77fa67b 100644 --- a/core/codegen/tests/ui-fail-stable/responder.stderr +++ b/core/codegen/tests/ui-fail-stable/responder.stderr @@ -1,11 +1,11 @@ error: need at least one field - --> $DIR/responder.rs:4:1 + --> tests/ui-fail-stable/responder.rs:4:1 | 4 | struct Thing1; - | ^^^^^^ + | ^^^^^^^^^^^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:3:10 + --> tests/ui-fail-stable/responder.rs:3:10 | 3 | #[derive(Responder)] | ^^^^^^^^^ @@ -13,13 +13,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: need at least one field - --> $DIR/responder.rs:7:14 + --> tests/ui-fail-stable/responder.rs:7:14 | 7 | struct Thing2(); | ^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:6:10 + --> tests/ui-fail-stable/responder.rs:6:10 | 6 | #[derive(Responder)] | ^^^^^^^^^ @@ -27,13 +27,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: need at least one field - --> $DIR/responder.rs:13:12 + --> tests/ui-fail-stable/responder.rs:13:12 | 13 | enum Foo { Bark, } | ^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:12:10 + --> tests/ui-fail-stable/responder.rs:12:10 | 12 | #[derive(Responder)] | ^^^^^^^^^ @@ -41,13 +41,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: only one lifetime is supported - --> $DIR/responder.rs:16:14 + --> tests/ui-fail-stable/responder.rs:16:14 | 16 | struct Thing4<'a, 'b>(&'a str, &'b str); - | ^ + | ^^^^^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:15:10 + --> tests/ui-fail-stable/responder.rs:15:10 | 15 | #[derive(Responder)] | ^^^^^^^^^ @@ -55,13 +55,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid or unknown content type - --> $DIR/responder.rs:25:27 + --> tests/ui-fail-stable/responder.rs:25:27 | 25 | #[response(content_type = "")] | ^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:24:10 + --> tests/ui-fail-stable/responder.rs:24:10 | 24 | #[derive(Responder)] | ^^^^^^^^^ @@ -69,13 +69,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid or unknown content type - --> $DIR/responder.rs:29:27 + --> tests/ui-fail-stable/responder.rs:29:27 | 29 | #[response(content_type = "idk")] | ^^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:28:10 + --> tests/ui-fail-stable/responder.rs:28:10 | 28 | #[derive(Responder)] | ^^^^^^^^^ @@ -83,13 +83,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid value: expected string literal - --> $DIR/responder.rs:33:27 + --> tests/ui-fail-stable/responder.rs:33:27 | 33 | #[response(content_type = 100)] | ^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:32:10 + --> tests/ui-fail-stable/responder.rs:32:10 | 32 | #[derive(Responder)] | ^^^^^^^^^ @@ -97,13 +97,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: status must be in range [100, 599] - --> $DIR/responder.rs:37:21 + --> tests/ui-fail-stable/responder.rs:37:21 | 37 | #[response(status = 8)] | ^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:36:10 + --> tests/ui-fail-stable/responder.rs:36:10 | 36 | #[derive(Responder)] | ^^^^^^^^^ @@ -111,13 +111,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid value: expected unsigned integer literal - --> $DIR/responder.rs:41:21 + --> tests/ui-fail-stable/responder.rs:41:21 | 41 | #[response(status = "404")] | ^^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:40:10 + --> tests/ui-fail-stable/responder.rs:40:10 | 40 | #[derive(Responder)] | ^^^^^^^^^ @@ -125,13 +125,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid value: expected unsigned integer literal - --> $DIR/responder.rs:45:21 + --> tests/ui-fail-stable/responder.rs:45:21 | 45 | #[response(status = "404", content_type = "html")] | ^^^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:44:10 + --> tests/ui-fail-stable/responder.rs:44:10 | 44 | #[derive(Responder)] | ^^^^^^^^^ @@ -139,13 +139,13 @@ error: [note] error occurred while deriving `Responder` = note: this error originates in the derive macro `Responder` (in Nightly builds, run with -Z macro-backtrace for more info) error: invalid value: expected string literal - --> $DIR/responder.rs:49:41 + --> tests/ui-fail-stable/responder.rs:49:41 | 49 | #[response(status = 404, content_type = 120)] | ^^^ error: [note] error occurred while deriving `Responder` - --> $DIR/responder.rs:48:10 + --> tests/ui-fail-stable/responder.rs:48:10 | 48 | #[derive(Responder)] | ^^^^^^^^^ diff --git a/core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.stderr b/core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.stderr index e8416f8d..fbb8f0f3 100644 --- a/core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.stderr +++ b/core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.stderr @@ -50,26 +50,26 @@ error: unexpected keyed parameter: expected literal or identifier --> tests/ui-fail-stable/route-attribute-general-syntax.rs:27:7 | 27 | #[get(data = "", "/")] - | ^^^^ + | ^^^^^^^^^^^^^^ error: unexpected attribute parameter: `unknown` --> tests/ui-fail-stable/route-attribute-general-syntax.rs:30:12 | 30 | #[get("/", unknown = "foo")] - | ^^^^^^^ + | ^^^^^^^^^^^^^^^ error: expected key/value `key = value` --> tests/ui-fail-stable/route-attribute-general-syntax.rs:33:12 | 33 | #[get("/", ...)] - | ^ + | ^^^ error: handler arguments must be named = help: to name an ignored handler argument, use `_name` --> tests/ui-fail-stable/route-attribute-general-syntax.rs:39:7 | 39 | fn c1(_: usize) {} - | ^ + | ^^^^^^^^ error: invalid value: expected string literal --> tests/ui-fail-stable/route-attribute-general-syntax.rs:43:7 @@ -167,36 +167,34 @@ error: invalid or unknown media type 90 | #[get("/", format = "text//foo")] | ^^^^^^^^^^^ -error: invalid HTTP method for route handlers - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` - --> tests/ui-fail-stable/route-attribute-general-syntax.rs:95:9 +error: expected key/value `key = value` + --> tests/ui-fail-stable/route-attribute-general-syntax.rs:95:18 | 95 | #[route(CONNECT, "/")] - | ^^^^^^^ + | ^^^ -error: invalid HTTP method - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` +error: invalid or unknown HTTP method + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL --> tests/ui-fail-stable/route-attribute-general-syntax.rs:98:9 | 98 | #[route(FIX, "/")] | ^^^ -error: expected identifier, found string literal - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` +error: invalid or unknown HTTP method + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL --> tests/ui-fail-stable/route-attribute-general-syntax.rs:101:9 | 101 | #[route("hi", "/")] | ^^^^ -error: expected identifier, found string literal - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` - --> tests/ui-fail-stable/route-attribute-general-syntax.rs:104:9 +error: expected key/value `key = value` + --> tests/ui-fail-stable/route-attribute-general-syntax.rs:104:16 | 104 | #[route("GET", "/")] - | ^^^^^ + | ^^^ -error: expected identifier, found integer literal - = help: method must be one of: `GET`, `PUT`, `POST`, `DELETE`, `HEAD`, `PATCH`, `OPTIONS` +error: expected method ident or string, found integer literal + = help: known methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH, ACL, BASELINE-CONTROL, BIND, CHECKIN, CHECKOUT, COPY, LABEL, LINK, LOCK, MERGE, MKACTIVITY, MKCALENDAR, MKCOL, MKREDIRECTREF, MKWORKSPACE, MOVE, ORDERPATCH, PROPFIND, PROPPATCH, REBIND, REPORT, SEARCH, UNBIND, UNCHECKOUT, UNLINK, UNLOCK, UPDATE, UPDATEREDIRECTREF, VERSION-CONTROL --> tests/ui-fail-stable/route-attribute-general-syntax.rs:107:9 | 107 | #[route(120, "/")] diff --git a/core/codegen/tests/ui-fail-stable/route-path-bad-syntax.stderr b/core/codegen/tests/ui-fail-stable/route-path-bad-syntax.stderr index 1aaccd57..fd640648 100644 --- a/core/codegen/tests/ui-fail-stable/route-path-bad-syntax.stderr +++ b/core/codegen/tests/ui-fail-stable/route-path-bad-syntax.stderr @@ -1,57 +1,57 @@ error: invalid route URI: expected token '/' but found 'a' at index 0 = help: expected URI in origin form: "/path/" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:5:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:5:8 | 5 | #[get("a")] - | ^^^ + | ^ error: invalid route URI: unexpected EOF: expected token '/' at index 0 = help: expected URI in origin form: "/path/" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:8:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:8:8 | 8 | #[get("")] - | ^^ + | ^ error: invalid route URI: expected token '/' but found 'a' at index 0 = help: expected URI in origin form: "/path/" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:11:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:11:8 | 11 | #[get("a/b/c")] - | ^^^^^^^ + | ^ error: route URIs cannot contain empty segments = note: expected "/a/b", found "/a///b" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:14:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:14:10 | 14 | #[get("/a///b")] - | ^^^^^^^^ + | ^^ error: route URIs cannot contain empty segments = note: expected "/?bat", found "/?bat&&" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:17:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:17:13 | 17 | #[get("/?bat&&")] - | ^^^^^^^^^ + | ^^ error: route URIs cannot contain empty segments = note: expected "/?bat", found "/?bat&&" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:20:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:20:13 | 20 | #[get("/?bat&&")] - | ^^^^^^^^^ + | ^^ error: route URIs cannot contain empty segments = note: expected "/a/b/", found "/a/b//" - --> tests/ui-fail-stable/route-path-bad-syntax.rs:23:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:23:12 | 23 | #[get("/a/b//")] - | ^^^^^^^^ + | ^^ error: unused parameter - --> tests/ui-fail-stable/route-path-bad-syntax.rs:42:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:42:10 | 42 | #[get("/")] - | ^^^^^^^^^ + | ^^^^ error: [note] expected argument named `name` here --> tests/ui-fail-stable/route-path-bad-syntax.rs:43:6 @@ -60,10 +60,10 @@ error: [note] expected argument named `name` here | ^^^^^^^^^^^^^^ error: unused parameter - --> tests/ui-fail-stable/route-path-bad-syntax.rs:45:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:45:12 | 45 | #[get("/a?")] - | ^^^^^^^^ + | ^ error: [note] expected argument named `r` here --> tests/ui-fail-stable/route-path-bad-syntax.rs:46:6 @@ -72,10 +72,10 @@ error: [note] expected argument named `r` here | ^^ error: unused parameter - --> tests/ui-fail-stable/route-path-bad-syntax.rs:48:21 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:48:23 | 48 | #[post("/a", data = "")] - | ^^^^^^^^ + | ^^^^ error: [note] expected argument named `test` here --> tests/ui-fail-stable/route-path-bad-syntax.rs:49:6 @@ -84,10 +84,10 @@ error: [note] expected argument named `test` here | ^^ error: unused parameter - --> tests/ui-fail-stable/route-path-bad-syntax.rs:51:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:51:10 | 51 | #[get("/<_r>")] - | ^^^^^^^ + | ^^ error: [note] expected argument named `_r` here --> tests/ui-fail-stable/route-path-bad-syntax.rs:52:6 @@ -96,10 +96,10 @@ error: [note] expected argument named `_r` here | ^^ error: unused parameter - --> tests/ui-fail-stable/route-path-bad-syntax.rs:54:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:54:15 | 54 | #[get("/<_r>/")] - | ^^^^^^^^^^^ + | ^ error: [note] expected argument named `b` here --> tests/ui-fail-stable/route-path-bad-syntax.rs:55:6 @@ -110,73 +110,73 @@ error: [note] expected argument named `b` here error: invalid identifier: `foo_.` = help: dynamic parameters must be valid identifiers = help: did you mean ``? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:60:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:60:10 | 60 | #[get("/")] - | ^^^^^^^^^^ + | ^^^^^ error: invalid identifier: `foo*` = help: dynamic parameters must be valid identifiers = help: did you mean ``? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:63:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:63:10 | 63 | #[get("/")] - | ^^^^^^^^^ + | ^^^^ error: invalid identifier: `!` = help: dynamic parameters must be valid identifiers = help: did you mean ``? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:66:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:66:10 | 66 | #[get("/")] - | ^^^^^^ + | ^ error: invalid identifier: `name>:`? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:69:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:69:10 | 69 | #[get("/:")] - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^ error: unexpected static parameter = help: parameter must be dynamic: `` - --> tests/ui-fail-stable/route-path-bad-syntax.rs:74:19 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:74:20 | 74 | #[get("/", data = "foo")] - | ^^^^^ + | ^^^ error: parameter cannot be trailing = help: did you mean ``? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:77:19 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:77:20 | 77 | #[get("/", data = "")] - | ^^^^^^^^^ + | ^^^^^^^ error: unexpected static parameter = help: parameter must be dynamic: `` - --> tests/ui-fail-stable/route-path-bad-syntax.rs:80:19 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:80:20 | 80 | #[get("/", data = "`? - --> tests/ui-fail-stable/route-path-bad-syntax.rs:83:19 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:83:21 | 83 | #[get("/", data = "")] - | ^^^^^^^^^ + | ^^^^^ error: handler arguments must be named = help: to name an ignored handler argument, use `_name` --> tests/ui-fail-stable/route-path-bad-syntax.rs:89:7 | 89 | fn k0(_: usize) {} - | ^ + | ^^^^^^^^ error: parameters cannot be empty - --> tests/ui-fail-stable/route-path-bad-syntax.rs:93:7 + --> tests/ui-fail-stable/route-path-bad-syntax.rs:93:9 | 93 | #[get("/<>")] - | ^^^^^ + | ^^ diff --git a/core/codegen/tests/ui-fail-stable/route-type-errors.stderr b/core/codegen/tests/ui-fail-stable/route-type-errors.stderr index dbde5a88..bebdea7c 100644 --- a/core/codegen/tests/ui-fail-stable/route-type-errors.stderr +++ b/core/codegen/tests/ui-fail-stable/route-type-errors.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:6:12 + --> tests/ui-fail-stable/route-type-errors.rs:6:13 | -6 | fn f0(foo: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +6 | fn f0(_foo: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: bool @@ -16,10 +16,10 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied and $N others error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:9:12 + --> tests/ui-fail-stable/route-type-errors.rs:9:13 | -9 | fn f1(foo: Q) {} - | ^ the trait `FromSegments<'_>` is not implemented for `Q` +9 | fn f1(_foo: Q) {} + | ^ the trait `FromSegments<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromSegments<'r>`: as FromSegments<'r>> @@ -28,10 +28,10 @@ error[E0277]: the trait bound `Q: FromSegments<'_>` is not satisfied >::Error> as FromSegments<'r>> error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:12:12 + --> tests/ui-fail-stable/route-type-errors.rs:12:13 | -12 | fn f2(foo: Q) {} - | ^ the trait `FromFormField<'_>` is not implemented for `Q` +12 | fn f2(_foo: Q) {} + | ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>` | = help: the following other types implement trait `FromFormField<'v>`: bool @@ -46,10 +46,10 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied = note: required for `Q` to implement `FromForm<'_>` error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:15:12 + --> tests/ui-fail-stable/route-type-errors.rs:15:13 | -15 | fn f3(foo: Q) {} - | ^ the trait `FromFormField<'_>` is not implemented for `Q` +15 | fn f3(_foo: Q) {} + | ^ the trait `FromFormField<'_>` is not implemented for `Q`, which is required by `Q: FromForm<'_>` | = help: the following other types implement trait `FromFormField<'v>`: bool @@ -64,44 +64,44 @@ error[E0277]: the trait bound `Q: FromFormField<'_>` is not satisfied = note: required for `Q` to implement `FromForm<'_>` error[E0277]: the trait bound `Q: FromData<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:18:12 + --> tests/ui-fail-stable/route-type-errors.rs:18:13 | -18 | fn f4(foo: Q) {} - | ^ the trait `FromData<'_>` is not implemented for `Q` +18 | fn f4(_foo: Q) {} + | ^ the trait `FromData<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromData<'r>`: rocket::Data<'r> Cow<'_, str> Capped> Capped> - Capped> Capped + Capped> Capped<&'r str> Capped<&'r RawStr> and $N others error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:21:10 + --> tests/ui-fail-stable/route-type-errors.rs:21:11 | -21 | fn f5(a: Q, foo: Q) {} - | ^ the trait `FromRequest<'_>` is not implemented for `Q` +21 | fn f5(_a: Q, _foo: Q) {} + | ^ the trait `FromRequest<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromRequest<'r>`: - rocket::http::Method + ProxyProto<'r> + Method Outcome>::Error), Status> - Flash<&'r rocket::http::CookieJar<'r>> + Flash<&'r CookieJar<'r>> rocket::Shutdown IpAddr std::net::SocketAddr std::option::Option - Result>::Error> and $N others error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:21:18 + --> tests/ui-fail-stable/route-type-errors.rs:21:20 | -21 | fn f5(a: Q, foo: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +21 | fn f5(_a: Q, _foo: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: bool @@ -115,27 +115,27 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied and $N others error[E0277]: the trait bound `Q: FromRequest<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:24:10 + --> tests/ui-fail-stable/route-type-errors.rs:24:11 | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromRequest<'_>` is not implemented for `Q` +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromRequest<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromRequest<'r>`: - rocket::http::Method + ProxyProto<'r> + Method Outcome>::Error), Status> - Flash<&'r rocket::http::CookieJar<'r>> + Flash<&'r CookieJar<'r>> rocket::Shutdown IpAddr std::net::SocketAddr std::option::Option - Result>::Error> and $N others error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:24:18 + --> tests/ui-fail-stable/route-type-errors.rs:24:20 | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: bool @@ -149,10 +149,10 @@ error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied and $N others error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied - --> tests/ui-fail-stable/route-type-errors.rs:24:39 + --> tests/ui-fail-stable/route-type-errors.rs:24:43 | -24 | fn f6(a: Q, foo: Q, good: usize, bar: Q) {} - | ^ the trait `FromParam<'_>` is not implemented for `Q` +24 | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} + | ^ the trait `FromParam<'_>` is not implemented for `Q` | = help: the following other types implement trait `FromParam<'a>`: bool diff --git a/core/codegen/tests/ui-fail-stable/route-warnings.stderr b/core/codegen/tests/ui-fail-stable/route-warnings.stderr index 4b3e10fd..c7d6d61e 100644 --- a/core/codegen/tests/ui-fail-stable/route-warnings.stderr +++ b/core/codegen/tests/ui-fail-stable/route-warnings.stderr @@ -1,5 +1,5 @@ error: checking for warnings! - --> $DIR/route-warnings.rs:25:5 + --> tests/ui-fail-stable/route-warnings.rs:33:5 | -25 | compile_error!("checking for warnings!") +33 | compile_error!("checking for warnings!") | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/core/codegen/tests/ui-fail-stable/typed-uri-bad-type.stderr b/core/codegen/tests/ui-fail-stable/typed-uri-bad-type.stderr index 5b529fc2..391abb10 100644 --- a/core/codegen/tests/ui-fail-stable/typed-uri-bad-type.stderr +++ b/core/codegen/tests/ui-fail-stable/typed-uri-bad-type.stderr @@ -1,52 +1,79 @@ error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:24:37 | -22 | fn optionals(id: Option, name: Result) { } - | ^^^^^^ expected `Empty`, found `&str` - -error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-stable/typed-uri-bad-type.rs:22:37 - | -22 | fn optionals(id: Option, name: Result) { } - | ^^^^^^ expected `&str`, found `Empty` +24 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^^^^^^^^^^ expected `Empty`, found `&str` error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:45:22 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 | -45 | uri!(simple(id = "hi")); - | ^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +47 | uri!(simple(id = "hi")); + | ----------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:47:17 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 | -47 | uri!(simple("hello")); - | ^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +49 | uri!(simple("hello")); + | --------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:49:22 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 | -49 | uri!(simple(id = 239239i64)); - | ^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +51 | uri!(simple(id = 239239i64)); + | ---------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:51:30 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:18:35 | -51 | uri!(not_uri_display(10, S)); +18 | fn not_uri_display(id: i32, name: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +53 | uri!(not_uri_display(10, S)); + | ---------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + > + > + > + > + > + and $N others + = note: this error originates in the macro `rocket_uri_macro_not_uri_display` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `S: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:53:30 + | +53 | uri!(not_uri_display(10, S)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: @@ -59,24 +86,32 @@ error[E0277]: the trait bound `S: FromUriParam` > > and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `i32: FromUriParam>` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:56:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:24:18 | -56 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); - | ^^^^ the trait `FromUriParam>` is not implemented for `i32` +24 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32`, which is required by `std::option::Option: FromUriParam` +... +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ------------------------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > = note: required for `std::option::Option` to implement `FromUriParam>` + = note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `std::string::String: FromUriParam>` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:56:42 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:24:37 | -56 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); - | ^^ the trait `FromUriParam>` is not implemented for `std::string::String` +24 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^^^^^^^^^^ the trait `FromUriParam>` is not implemented for `std::string::String`, which is required by `Result: FromUriParam` +... +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ------------------------------------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > @@ -86,33 +121,63 @@ error[E0277]: the trait bound `std::string::String: FromUriParam> > = note: required for `Result` to implement `FromUriParam>` + = note: this error originates in the macro `rocket_uri_macro_optionals` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:58:19 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:38:17 | -58 | uri!(simple_q("hi")); - | ^^^^ the trait `FromUriParam` is not implemented for `isize` +38 | fn simple_q(id: isize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `isize` +... +60 | uri!(simple_q("hi")); + | -------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > + = note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `isize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:60:24 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:38:17 | -60 | uri!(simple_q(id = "hi")); - | ^^^^ the trait `FromUriParam` is not implemented for `isize` +38 | fn simple_q(id: isize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `isize` +... +62 | uri!(simple_q(id = "hi")); + | ------------------------- in this macro invocation | = help: the following other types implement trait `FromUriParam`: > > > + = note: this error originates in the macro `rocket_uri_macro_simple_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:62:23 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:41:29 | -62 | uri!(other_q(100, S)); +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +64 | uri!(other_q(100, S)); + | --------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + > + > + > + > + > + and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `S: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:64:23 + | +64 | uri!(other_q(100, S)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: @@ -125,11 +190,33 @@ error[E0277]: the trait bound `S: FromUriParam > > and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:64:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:41:29 | -64 | uri!(other_q(rest = S, id = 100)); +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +66 | uri!(other_q(rest = S, id = 100)); + | --------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + > + > + > + > + > + and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `S: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:66:25 + | +66 | uri!(other_q(rest = S, id = 100)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: @@ -142,11 +229,12 @@ error[E0277]: the trait bound `S: FromUriParam > > and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `S: Ignorable` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:66:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:68:25 | -66 | uri!(other_q(rest = _, id = 100)); +68 | uri!(other_q(rest = _, id = 100)); | ^ the trait `Ignorable` is not implemented for `S` | = help: the following other types implement trait `Ignorable

`: @@ -159,9 +247,9 @@ note: required by a bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable` error[E0277]: the trait bound `usize: Ignorable` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:68:33 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:70:33 | -68 | uri!(other_q(rest = S, id = _)); +70 | uri!(other_q(rest = S, id = _)); | ^ the trait `Ignorable` is not implemented for `usize` | = help: the following other types implement trait `Ignorable

`: @@ -174,9 +262,30 @@ note: required by a bound in `assert_ignorable` | ^^^^^^^^^^^^ required by this bound in `assert_ignorable` error[E0277]: the trait bound `S: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:68:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:41:29 | -68 | uri!(other_q(rest = S, id = _)); +41 | fn other_q(id: usize, rest: S) { } + | ^ the trait `FromUriParam` is not implemented for `S` +... +70 | uri!(other_q(rest = S, id = _)); + | ------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + > + > + > + > + > + and $N others + = note: this error originates in the macro `rocket_uri_macro_other_q` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `S: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:70:25 + | +70 | uri!(other_q(rest = S, id = _)); | ^ the trait `FromUriParam` is not implemented for `S` | = help: the following other types implement trait `FromUriParam`: @@ -189,123 +298,265 @@ error[E0277]: the trait bound `S: FromUriParam > > and $N others + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:77:40 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 | -77 | uri!(uri!("?foo#bar"), simple(id = "hi")); +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); + | ----------------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:79:15 + | +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); + | -----^^^^^^^^^^- + | | | + | | the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Reference<'_>` + | required by a bound introduced by this call + | + = help: the following other types implement trait `ValidRoutePrefix`: + rocket::http::uri::Origin<'a> + rocket::http::uri::Absolute<'a> +note: required by a bound in `RouteUriBuilder::with_prefix` + --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs + | + | pub fn with_prefix(self, p: P) -> PrefixedRouteUri { + | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 + | +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +80 | uri!(uri!("*"), simple(id = "hi")); + | ---------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:80:15 + | +80 | uri!(uri!("*"), simple(id = "hi")); + | -----^^^- + | | | + | | the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Asterisk` + | required by a bound introduced by this call + | + = help: the following other types implement trait `ValidRoutePrefix`: + rocket::http::uri::Origin<'a> + rocket::http::uri::Absolute<'a> +note: required by a bound in `RouteUriBuilder::with_prefix` + --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs + | + | pub fn with_prefix(self, p: P) -> PrefixedRouteUri { + | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 + | +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +83 | uri!(_, simple(id = "hi"), uri!("*")); + | ------------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix>` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:83:37 + | +83 | uri!(_, simple(id = "hi"), uri!("*")); + | -----^^^- + | | | + | | the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Asterisk` + | required by a bound introduced by this call + | + = help: the following other types implement trait `ValidRouteSuffix`: + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> +note: required by a bound in `RouteUriBuilder::with_suffix` + --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs + | + | pub fn with_suffix(self, suffix: S) -> SuffixedRouteUri + | ----------- required by a bound in this associated function + | where S: ValidRouteSuffix> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:15:15 + | +15 | fn simple(id: usize) { } + | ^^^^^ the trait `FromUriParam` is not implemented for `usize` +... +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); + | -------------------------------------------- in this macro invocation + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket_uri_macro_simple` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix>` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:84:37 + | +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); + | -----^^^^^^^^^^- + | | | + | | the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Origin<'_>` + | required by a bound introduced by this call + | + = help: the following other types implement trait `ValidRouteSuffix`: + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> + as ValidRouteSuffix>> +note: required by a bound in `RouteUriBuilder::with_suffix` + --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs + | + | pub fn with_suffix(self, suffix: S) -> SuffixedRouteUri + | ----------- required by a bound in this associated function + | where S: ValidRouteSuffix> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:47:22 + | +47 | uri!(simple(id = "hi")); + | ^^^^ the trait `FromUriParam` is not implemented for `usize` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:49:17 + | +49 | uri!(simple("hello")); + | ^^^^^^^ the trait `FromUriParam` is not implemented for `usize` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:51:22 + | +51 | uri!(simple(id = 239239i64)); + | ^^^^^^^^^ the trait `FromUriParam` is not implemented for `usize` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `i32: FromUriParam>` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:58:25 + | +58 | uri!(optionals(id = Some(10), name = Ok("bob".into()))); + | ^^^^^^^^ the trait `FromUriParam>` is not implemented for `i32`, which is required by `std::option::Option: FromUriParam>` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: required for `std::option::Option` to implement `FromUriParam>` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `isize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:60:19 + | +60 | uri!(simple_q("hi")); + | ^^^^ the trait `FromUriParam` is not implemented for `isize` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `isize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:62:24 + | +62 | uri!(simple_q(id = "hi")); + | ^^^^ the trait `FromUriParam` is not implemented for `isize` + | + = help: the following other types implement trait `FromUriParam`: + > + > + > + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) + +error[E0277]: the trait bound `usize: FromUriParam` is not satisfied + --> tests/ui-fail-stable/typed-uri-bad-type.rs:79:40 + | +79 | uri!(uri!("?foo#bar"), simple(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: > > > - -error[E0277]: the trait bound `rocket::http::uri::Reference<'_>: ValidRoutePrefix` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:77:15 - | -77 | uri!(uri!("?foo#bar"), simple(id = "hi")); - | --- ^^^^^^^^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Reference<'_>` - | | - | required by a bound introduced by this call - | - = help: the following other types implement trait `ValidRoutePrefix`: - rocket::http::uri::Origin<'a> - rocket::http::uri::Absolute<'a> -note: required by a bound in `RouteUriBuilder::with_prefix` - --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs - | - | pub fn with_prefix(self, p: P) -> PrefixedRouteUri { - | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:78:33 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:80:33 | -78 | uri!(uri!("*"), simple(id = "hi")); +80 | uri!(uri!("*"), simple(id = "hi")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: > > > - -error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRoutePrefix` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:78:15 - | -78 | uri!(uri!("*"), simple(id = "hi")); - | --- ^^^ the trait `ValidRoutePrefix` is not implemented for `rocket::http::uri::Asterisk` - | | - | required by a bound introduced by this call - | - = help: the following other types implement trait `ValidRoutePrefix`: - rocket::http::uri::Origin<'a> - rocket::http::uri::Absolute<'a> -note: required by a bound in `RouteUriBuilder::with_prefix` - --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs - | - | pub fn with_prefix(self, p: P) -> PrefixedRouteUri { - | ^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_prefix` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:81:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:83:25 | -81 | uri!(_, simple(id = "hi"), uri!("*")); +83 | uri!(_, simple(id = "hi"), uri!("*")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: > > > - -error[E0277]: the trait bound `rocket::http::uri::Asterisk: ValidRouteSuffix>` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:81:37 - | -81 | uri!(_, simple(id = "hi"), uri!("*")); - | --- ^^^ the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Asterisk` - | | - | required by a bound introduced by this call - | - = help: the following other types implement trait `ValidRouteSuffix`: - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> -note: required by a bound in `RouteUriBuilder::with_suffix` - --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs - | - | pub fn with_suffix(self, suffix: S) -> SuffixedRouteUri - | ----------- required by a bound in this associated function - | where S: ValidRouteSuffix> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `usize: FromUriParam` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:82:25 + --> tests/ui-fail-stable/typed-uri-bad-type.rs:84:25 | -82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); +84 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); | ^^^^ the trait `FromUriParam` is not implemented for `usize` | = help: the following other types implement trait `FromUriParam`: > > > - -error[E0277]: the trait bound `rocket::http::uri::Origin<'_>: ValidRouteSuffix>` is not satisfied - --> tests/ui-fail-stable/typed-uri-bad-type.rs:82:37 - | -82 | uri!(_, simple(id = "hi"), uri!("/foo/bar")); - | --- ^^^^^^^^^^ the trait `ValidRouteSuffix>` is not implemented for `rocket::http::uri::Origin<'_>` - | | - | required by a bound introduced by this call - | - = help: the following other types implement trait `ValidRouteSuffix`: - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> - as ValidRouteSuffix>> -note: required by a bound in `RouteUriBuilder::with_suffix` - --> $WORKSPACE/core/http/src/uri/fmt/formatter.rs - | - | pub fn with_suffix(self, suffix: S) -> SuffixedRouteUri - | ----------- required by a bound in this associated function - | where S: ValidRouteSuffix> - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `RouteUriBuilder::with_suffix` + = note: this error originates in the macro `rocket::rocket_internal_uri` which comes from the expansion of the macro `uri` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/core/codegen/tests/ui-fail-stable/typed-uris-bad-params.stderr b/core/codegen/tests/ui-fail-stable/typed-uris-bad-params.stderr index b57d6dc2..324572db 100644 --- a/core/codegen/tests/ui-fail-stable/typed-uris-bad-params.stderr +++ b/core/codegen/tests/ui-fail-stable/typed-uris-bad-params.stderr @@ -1,285 +1,279 @@ error: expected identifier, found keyword `_` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:63:18 - | -63 | uri!(ignored(_ = 10)); - | ^ - -error: route expects 1 parameter but 2 were supplied - = note: route `ignored` has uri "/<_>" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:69:18 - | -69 | uri!(ignored(10, "10")); - | ^^ - -error: expected unnamed arguments due to ignored parameters - = note: uri for route `ignored` ignores path parameters: "/<_>" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:67:18 - | -67 | uri!(ignored(num = 10)); - | ^^^ - -error: route expects 1 parameter but 2 were supplied - = note: route `ignored` has uri "/<_>" --> tests/ui-fail-stable/typed-uris-bad-params.rs:65:18 | -65 | uri!(ignored(10, 20)); - | ^^ +65 | uri!(ignored(_ = 10)); + | ^ + +error: route expects 1 parameter but 2 were supplied + = note: route `ignored` has uri "/<_>" + --> tests/ui-fail-stable/typed-uris-bad-params.rs:71:18 + | +71 | uri!(ignored(10, "10")); + | ^^^^^^^^ + +error: expected unnamed arguments due to ignored parameters + = note: uri for route `ignored` ignores 1 path parameters: "/<_>" + --> tests/ui-fail-stable/typed-uris-bad-params.rs:69:18 + | +69 | uri!(ignored(num = 10)); + | ^^^^^^^^ + +error: route expects 1 parameter but 2 were supplied + = note: route `ignored` has uri "/<_>" + --> tests/ui-fail-stable/typed-uris-bad-params.rs:67:18 + | +67 | uri!(ignored(10, 20)); + | ^^^^^^ error: path parameters cannot be ignored - --> tests/ui-fail-stable/typed-uris-bad-params.rs:61:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:63:18 | -61 | uri!(ignored(_)); +63 | uri!(ignored(_)); | ^ error: path parameters cannot be ignored - --> tests/ui-fail-stable/typed-uris-bad-params.rs:59:36 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:61:36 | -59 | uri!(optionals(id = 10, name = _)); +61 | uri!(optionals(id = 10, name = _)); | ^ error: path parameters cannot be ignored - --> tests/ui-fail-stable/typed-uris-bad-params.rs:57:25 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:59:25 | -57 | uri!(optionals(id = _, name = "bob".into())); +59 | uri!(optionals(id = _, name = "bob".into())); | ^ +error: invalid parameters for `has_two` route uri + = note: uri parameters are: id: i32, name: String + = help: missing parameter: `name` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:57:18 + | +57 | uri!(has_two(id = 100, cookies = "hi")); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: [help] unknown parameter: `cookies` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:57:28 + | +57 | uri!(has_two(id = 100, cookies = "hi")); + | ^^^^^^^ + error: invalid parameters for `has_two` route uri = note: uri parameters are: id: i32, name: String = help: missing parameter: `name` --> tests/ui-fail-stable/typed-uris-bad-params.rs:55:18 | -55 | uri!(has_two(id = 100, cookies = "hi")); - | ^^ +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: [help] unknown parameter: `cookies` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:55:28 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:55:18 | -55 | uri!(has_two(id = 100, cookies = "hi")); - | ^^^^^^^ - -error: invalid parameters for `has_two` route uri - = note: uri parameters are: id: i32, name: String - = help: missing parameter: `name` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:53:18 - | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); - | ^^^^^^^ - -error: [help] unknown parameter: `cookies` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:53:18 - | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); | ^^^^^^^ error: [help] duplicate parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:53:44 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:55:44 | -53 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); +55 | uri!(has_two(cookies = "hi", id = 100, id = 10, id = 10)); | ^^ error: invalid parameters for `has_two` route uri = note: uri parameters are: id: i32, name: String = help: missing parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:51:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:53:18 | -51 | uri!(has_two(name = "hi")); - | ^^^^ +53 | uri!(has_two(name = "hi")); + | ^^^^^^^^^^^ error: invalid parameters for `has_two` route uri = note: uri parameters are: id: i32, name: String = help: missing parameter: `name` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:49:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:51:18 | -49 | uri!(has_two(id = 100, id = 100, )); - | ^^ +51 | uri!(has_two(id = 100, id = 100, )); + | ^^^^^^^^^^^^^^^^^^^ error: [help] duplicate parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:49:28 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:51:28 | -49 | uri!(has_two(id = 100, id = 100, )); +51 | uri!(has_two(id = 100, id = 100, )); | ^^ +error: invalid parameters for `has_one_guarded` route uri + = note: uri parameters are: id: i32 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:49:26 + | +49 | uri!(has_one_guarded(id = 100, cookies = "hi")); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: [help] unknown parameter: `cookies` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:49:36 + | +49 | uri!(has_one_guarded(id = 100, cookies = "hi")); + | ^^^^^^^ + error: invalid parameters for `has_one_guarded` route uri = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:47:26 | -47 | uri!(has_one_guarded(id = 100, cookies = "hi")); - | ^^ +47 | uri!(has_one_guarded(cookies = "hi", id = 100)); + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: [help] unknown parameter: `cookies` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:47:36 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:47:26 | -47 | uri!(has_one_guarded(id = 100, cookies = "hi")); - | ^^^^^^^ - -error: invalid parameters for `has_one_guarded` route uri - = note: uri parameters are: id: i32 - --> tests/ui-fail-stable/typed-uris-bad-params.rs:45:26 - | -45 | uri!(has_one_guarded(cookies = "hi", id = 100)); - | ^^^^^^^ - -error: [help] unknown parameter: `cookies` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:45:26 - | -45 | uri!(has_one_guarded(cookies = "hi", id = 100)); +47 | uri!(has_one_guarded(cookies = "hi", id = 100)); | ^^^^^^^ error: invalid parameters for `has_one` route uri = note: uri parameters are: id: i32 = help: missing parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:43:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:45:18 | -43 | uri!(has_one(name = "hi")); - | ^^^^ +45 | uri!(has_one(name = "hi")); + | ^^^^^^^^^^^ error: [help] unknown parameter: `name` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:45:18 + | +45 | uri!(has_one(name = "hi")); + | ^^^^ + +error: invalid parameters for `has_one` route uri + = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:43:18 | -43 | uri!(has_one(name = "hi")); - | ^^^^ +43 | uri!(has_one(id = 100, id = 100, )); + | ^^^^^^^^^^^^^^^^^^^ + +error: [help] duplicate parameter: `id` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:43:28 + | +43 | uri!(has_one(id = 100, id = 100, )); + | ^^ error: invalid parameters for `has_one` route uri = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:41:18 | -41 | uri!(has_one(id = 100, id = 100, )); - | ^^ +41 | uri!(has_one(id = 100, id = 100)); + | ^^^^^^^^^^^^^^^^^^ error: [help] duplicate parameter: `id` --> tests/ui-fail-stable/typed-uris-bad-params.rs:41:28 | -41 | uri!(has_one(id = 100, id = 100, )); +41 | uri!(has_one(id = 100, id = 100)); | ^^ error: invalid parameters for `has_one` route uri = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:39:18 | -39 | uri!(has_one(id = 100, id = 100)); - | ^^ - -error: [help] duplicate parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:39:28 - | -39 | uri!(has_one(id = 100, id = 100)); - | ^^ - -error: invalid parameters for `has_one` route uri - = note: uri parameters are: id: i32 - --> tests/ui-fail-stable/typed-uris-bad-params.rs:37:18 - | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); - | ^^^^ +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: [help] unknown parameters: `name`, `age` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:37:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:39:18 | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); | ^^^^ error: [help] duplicate parameter: `id` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:37:50 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:39:50 | -37 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); +39 | uri!(has_one(name = 100, age = 50, id = 100, id = 50)); | ^^ error: invalid parameters for `has_one` route uri = note: uri parameters are: id: i32 - --> tests/ui-fail-stable/typed-uris-bad-params.rs:35:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:37:18 | -35 | uri!(has_one(name = 100, age = 50, id = 100)); - | ^^^^ +37 | uri!(has_one(name = 100, age = 50, id = 100)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: [help] unknown parameters: `name`, `age` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:37:18 + | +37 | uri!(has_one(name = 100, age = 50, id = 100)); + | ^^^^ + +error: invalid parameters for `has_one` route uri + = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:35:18 | -35 | uri!(has_one(name = 100, age = 50, id = 100)); +35 | uri!(has_one(name = 100, id = 100)); + | ^^^^^^^^^^^^^^^^^^^^ + +error: [help] unknown parameter: `name` + --> tests/ui-fail-stable/typed-uris-bad-params.rs:35:18 + | +35 | uri!(has_one(name = 100, id = 100)); | ^^^^ error: invalid parameters for `has_one` route uri = note: uri parameters are: id: i32 --> tests/ui-fail-stable/typed-uris-bad-params.rs:33:18 | -33 | uri!(has_one(name = 100, id = 100)); - | ^^^^ +33 | uri!(has_one(id = 100, name = "hi")); + | ^^^^^^^^^^^^^^^^^^^^^ error: [help] unknown parameter: `name` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:33:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:33:28 | -33 | uri!(has_one(name = 100, id = 100)); - | ^^^^ - -error: invalid parameters for `has_one` route uri - = note: uri parameters are: id: i32 - --> tests/ui-fail-stable/typed-uris-bad-params.rs:31:18 - | -31 | uri!(has_one(id = 100, name = "hi")); - | ^^ - -error: [help] unknown parameter: `name` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:31:28 - | -31 | uri!(has_one(id = 100, name = "hi")); +33 | uri!(has_one(id = 100, name = "hi")); | ^^^^ error: route expects 2 parameters but 1 was supplied = note: route `has_two` has uri "/?" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:29:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:31:18 | -29 | uri!(has_two(10)); +31 | uri!(has_two(10)); | ^^ error: route expects 2 parameters but 3 were supplied = note: route `has_two` has uri "/?" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:28:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:30:18 | -28 | uri!(has_two(10, "hi", "there")); - | ^^ +30 | uri!(has_two(10, "hi", "there")); + | ^^^^^^^^^^^^^^^^^ error: route expects 1 parameter but 2 were supplied = note: route `has_one_guarded` has uri "/" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:26:26 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:28:26 | -26 | uri!(has_one_guarded("hi", 100)); - | ^^^^ +28 | uri!(has_one_guarded("hi", 100)); + | ^^^^^^^^^ error: route expects 1 parameter but 2 were supplied = note: route `has_one` has uri "/" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:25:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:27:18 | -25 | uri!(has_one("Hello", 23, )); - | ^^^^^^^ +27 | uri!(has_one("Hello", 23, )); + | ^^^^^^^^^^^^ error: route expects 1 parameter but 2 were supplied = note: route `has_one` has uri "/" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:24:18 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:26:18 | -24 | uri!(has_one(1, 23)); - | ^ +26 | uri!(has_one(1, 23)); + | ^^^^^ error: route expects 1 parameter but 0 were supplied = note: route `has_one` has uri "/" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:22:10 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:24:10 | -22 | uri!(has_one()); +24 | uri!(has_one()); | ^^^^^^^ error: route expects 1 parameter but 0 were supplied = note: route `has_one` has uri "/" - --> tests/ui-fail-stable/typed-uris-bad-params.rs:21:10 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:23:10 | -21 | uri!(has_one); +23 | uri!(has_one); | ^^^^^^^ error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:15:37 + --> tests/ui-fail-stable/typed-uris-bad-params.rs:17:37 | -15 | fn optionals(id: Option, name: Result) { } - | ^^^^^^ expected `Empty`, found `&str` - -error[E0271]: type mismatch resolving `>::Error == &str` - --> tests/ui-fail-stable/typed-uris-bad-params.rs:15:37 - | -15 | fn optionals(id: Option, name: Result) { } - | ^^^^^^ expected `&str`, found `Empty` +17 | fn optionals(id: Option, name: Result) { } + | ^^^^^^^^^^^^^^^^^^^^ expected `Empty`, found `&str` diff --git a/core/codegen/tests/ui-fail-stable/typed-uris-invalid-syntax.stderr b/core/codegen/tests/ui-fail-stable/typed-uris-invalid-syntax.stderr index 00b70d54..3ae86f94 100644 --- a/core/codegen/tests/ui-fail-stable/typed-uris-invalid-syntax.stderr +++ b/core/codegen/tests/ui-fail-stable/typed-uris-invalid-syntax.stderr @@ -8,13 +8,13 @@ error: named and unnamed parameters cannot be mixed --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:11:17 | 11 | uri!(simple(id = 100, "Hello")); - | ^^ + | ^^^^^^^^^^^^^^^^^ error: named and unnamed parameters cannot be mixed --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:12:17 | 12 | uri!(simple("Hello", id = 100)); - | ^^^^^^^ + | ^^^^^^^^^^^^^^^^^ error: unexpected token --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:14:16 @@ -23,16 +23,16 @@ error: unexpected token | ^ error: invalid URI: unexpected EOF: expected token ':' at index 5 - --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:16:10 + --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:16:16 | 16 | uri!("mount", simple); - | ^^^^^^^ + | ^ error: invalid URI: unexpected EOF: expected token ':' at index 5 - --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:17:10 + --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:17:16 | 17 | uri!("mount", simple, "http://"); - | ^^^^^^^ + | ^ error: URI suffix must contain only query and/or fragment --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:18:28 @@ -47,10 +47,10 @@ error: expected 1, 2, or 3 arguments, found 4 | ^^^^^^ error: invalid URI: unexpected EOF: expected token ':' at index 5 - --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:20:10 + --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:20:16 | 20 | uri!("mount", simple(10, "hi"), "http://"); - | ^^^^^^^ + | ^ error: URI suffix must contain only query and/or fragment --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:21:38 @@ -77,10 +77,10 @@ error: expected 1, 2, or 3 arguments, found 4 | ^^^^^^ error: invalid URI: unexpected token '<' at index 7 - --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:25:10 + --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:25:18 | 25 | uri!("/mount/", simple); - | ^^^^^^^^^^^^^ + | ^ error: expected at least 1 argument, found none --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:26:5 @@ -103,10 +103,10 @@ error: unexpected end of input, expected an expression | ^ error: invalid URI: unexpected EOF: expected some token at index 0 - --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:29:10 + --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:29:11 | 29 | uri!("*", simple(10), "hi"); - | ^^^ + | ^ error: URI suffix must contain only query and/or fragment --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:30:40 @@ -145,7 +145,7 @@ error: URI suffix must contain only query and/or fragment | ^^^^^^^^^ error: route expects 2 parameters but 0 were supplied - = note: route `simple` has uri "//" + = note: route `simple` has uri "/<_id>/<_name>" --> tests/ui-fail-stable/typed-uris-invalid-syntax.rs:13:10 | 13 | uri!(simple,); diff --git a/core/codegen/tests/ui-fail-stable/uri_display.stderr b/core/codegen/tests/ui-fail-stable/uri_display.stderr index deacb670..6e41d21f 100644 --- a/core/codegen/tests/ui-fail-stable/uri_display.stderr +++ b/core/codegen/tests/ui-fail-stable/uri_display.stderr @@ -1,11 +1,11 @@ error: fieldless structs are not supported - --> $DIR/uri_display.rs:4:1 + --> tests/ui-fail-stable/uri_display.rs:4:1 | 4 | struct Foo1; - | ^^^^^^ + | ^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:3:10 + --> tests/ui-fail-stable/uri_display.rs:3:10 | 3 | #[derive(UriDisplayQuery)] | ^^^^^^^^^^^^^^^ @@ -13,13 +13,13 @@ error: [note] error occurred while deriving `UriDisplay` = note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info) error: fieldless structs are not supported - --> $DIR/uri_display.rs:7:1 + --> tests/ui-fail-stable/uri_display.rs:7:1 | 7 | struct Foo2(); - | ^^^^^^ + | ^^^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:6:10 + --> tests/ui-fail-stable/uri_display.rs:6:10 | 6 | #[derive(UriDisplayQuery)] | ^^^^^^^^^^^^^^^ @@ -27,13 +27,13 @@ error: [note] error occurred while deriving `UriDisplay` = 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:10:11 + --> tests/ui-fail-stable/uri_display.rs:10:11 | 10 | enum Foo3 { } | ^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:9:10 + --> tests/ui-fail-stable/uri_display.rs:9:10 | 9 | #[derive(UriDisplayQuery)] | ^^^^^^^^^^^^^^^ @@ -41,13 +41,13 @@ error: [note] error occurred while deriving `UriDisplay` = 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:18:12 + --> tests/ui-fail-stable/uri_display.rs:18:12 | 18 | struct Foo5(String, String); | ^^^^^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:17:10 + --> tests/ui-fail-stable/uri_display.rs:17:10 | 17 | #[derive(UriDisplayQuery)] | ^^^^^^^^^^^^^^^ @@ -55,13 +55,13 @@ error: [note] error occurred while deriving `UriDisplay` = note: this error originates in the derive macro `UriDisplayQuery` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected list `#[attr(..)]`, found bare integer literal - --> $DIR/uri_display.rs:22:20 + --> tests/ui-fail-stable/uri_display.rs:22:20 | 22 | #[field(name = 123)] | ^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:20:10 + --> tests/ui-fail-stable/uri_display.rs:20:10 | 20 | #[derive(UriDisplayQuery)] | ^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ error: [note] error occurred while deriving `UriDisplay` = 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:27:12 + --> tests/ui-fail-stable/uri_display.rs:27:12 | 27 | struct Foo7(String, usize); | ^^^^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:26:10 + --> tests/ui-fail-stable/uri_display.rs:26:10 | 26 | #[derive(UriDisplayPath)] | ^^^^^^^^^^^^^^ @@ -83,13 +83,13 @@ error: [note] error occurred while deriving `UriDisplay` = 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:30:1 + --> tests/ui-fail-stable/uri_display.rs:30:1 | 30 | struct Foo8; - | ^^^^^^ + | ^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:29:10 + --> tests/ui-fail-stable/uri_display.rs:29:10 | 29 | #[derive(UriDisplayPath)] | ^^^^^^^^^^^^^^ @@ -97,13 +97,13 @@ error: [note] error occurred while deriving `UriDisplay` = 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:33:1 + --> tests/ui-fail-stable/uri_display.rs:33:1 | 33 | enum Foo9 { } - | ^^^^ + | ^^^^^^^^^^^^^^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:32:10 + --> tests/ui-fail-stable/uri_display.rs:32:10 | 32 | #[derive(UriDisplayPath)] | ^^^^^^^^^^^^^^ @@ -111,13 +111,15 @@ error: [note] error occurred while deriving `UriDisplay` = 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:36:1 + --> tests/ui-fail-stable/uri_display.rs:36:1 | -36 | struct Foo10 { - | ^^^^^^ +36 | / struct Foo10 { +37 | | named: usize +38 | | } + | |_^ error: [note] error occurred while deriving `UriDisplay` - --> $DIR/uri_display.rs:35:10 + --> tests/ui-fail-stable/uri_display.rs:35:10 | 35 | #[derive(UriDisplayPath)] | ^^^^^^^^^^^^^^ diff --git a/core/codegen/tests/ui-fail-stable/uri_display_type_errors.stderr b/core/codegen/tests/ui-fail-stable/uri_display_type_errors.stderr index 92916ace..05f5b636 100644 --- a/core/codegen/tests/ui-fail-stable/uri_display_type_errors.stderr +++ b/core/codegen/tests/ui-fail-stable/uri_display_type_errors.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:6:13 | 6 | struct Bar1(BadType); - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -25,7 +25,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:10:5 | 10 | field: BadType, - | ^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -48,7 +48,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:16:5 | 16 | bad: BadType, - | ^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -71,7 +71,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:21:11 | 21 | Inner(BadType), - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -96,7 +96,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:27:9 | 27 | field: BadType, - | ^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -121,7 +121,7 @@ error[E0277]: the trait bound `BadType: UriDisplay tests/ui-fail-stable/uri_display_type_errors.rs:35:9 | 35 | other: BadType, - | ^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > @@ -146,7 +146,7 @@ error[E0277]: the trait bound `BadType: UriDisplay --> tests/ui-fail-stable/uri_display_type_errors.rs:40:12 | 40 | struct Baz(BadType); - | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType` + | ^^^^^^^ the trait `UriDisplay` is not implemented for `BadType`, which is required by `&BadType: UriDisplay` | = help: the following other types implement trait `UriDisplay

`: > diff --git a/core/codegen/tests/ui-fail/catch.rs b/core/codegen/tests/ui-fail/catch.rs index e4a38d19..948f9045 100644 --- a/core/codegen/tests/ui-fail/catch.rs +++ b/core/codegen/tests/ui-fail/catch.rs @@ -27,6 +27,6 @@ fn e5(_request: &Request) { } fn e5(_request: &Request) { } #[catch(404)] -fn f3(_request: &Request, other: bool) { } +fn f3(_request: &Request, _other: bool) { } fn main() { } diff --git a/core/codegen/tests/ui-fail/route-type-errors.rs b/core/codegen/tests/ui-fail/route-type-errors.rs index 17991aa7..dba442d7 100644 --- a/core/codegen/tests/ui-fail/route-type-errors.rs +++ b/core/codegen/tests/ui-fail/route-type-errors.rs @@ -2,25 +2,25 @@ struct Q; -#[get("/")] -fn f0(foo: Q) {} +#[get("/<_foo>")] +fn f0(_foo: Q) {} -#[get("/")] -fn f1(foo: Q) {} +#[get("/<_foo..>")] +fn f1(_foo: Q) {} -#[get("/?")] -fn f2(foo: Q) {} +#[get("/?<_foo>")] +fn f2(_foo: Q) {} -#[get("/?")] -fn f3(foo: Q) {} +#[get("/?<_foo..>")] +fn f3(_foo: Q) {} -#[post("/", data = "")] -fn f4(foo: Q) {} +#[post("/", data = "<_foo>")] +fn f4(_foo: Q) {} -#[get("/")] -fn f5(a: Q, foo: Q) {} +#[get("/<_foo>")] +fn f5(_a: Q, _foo: Q) {} -#[get("//other///okay")] -fn f6(a: Q, foo: Q, good: usize, bar: Q) {} +#[get("/<_foo>/other/<_bar>/<_good>/okay")] +fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {} fn main() { } diff --git a/core/codegen/tests/ui-fail/route-warnings.rs b/core/codegen/tests/ui-fail/route-warnings.rs index 95e8c8c8..1033c9b6 100644 --- a/core/codegen/tests/ui-fail/route-warnings.rs +++ b/core/codegen/tests/ui-fail/route-warnings.rs @@ -13,6 +13,10 @@ fn f1() {} #[get("/", format = "x-custom/x-custom")] fn f2() {} +#[suppress(unknown_format)] +#[get("/", format = "x-custom/x-custom")] +fn f3() {} + // Check if a data argument is used with a usually non-payload bearing method. #[get("/", data = "<_foo>")] @@ -21,6 +25,10 @@ fn g0(_foo: rocket::Data<'_>) {} #[head("/", data = "<_foo>")] fn g1(_foo: rocket::Data<'_>) {} +#[suppress(dubious_payload)] +#[head("/", data = "<_foo>")] +fn g2(_foo: rocket::Data<'_>) {} + fn main() { compile_error!("checking for warnings!") } diff --git a/core/codegen/tests/ui-fail/typed-uri-bad-type.rs b/core/codegen/tests/ui-fail/typed-uri-bad-type.rs index 5d4cd568..b92aef41 100644 --- a/core/codegen/tests/ui-fail/typed-uri-bad-type.rs +++ b/core/codegen/tests/ui-fail/typed-uri-bad-type.rs @@ -1,3 +1,5 @@ +#![allow(unused_variables)] + #[macro_use] extern crate rocket; use rocket::request::FromParam; diff --git a/core/codegen/tests/ui-fail/typed-uris-bad-params.rs b/core/codegen/tests/ui-fail/typed-uris-bad-params.rs index 68464338..cbee347f 100644 --- a/core/codegen/tests/ui-fail/typed-uris-bad-params.rs +++ b/core/codegen/tests/ui-fail/typed-uris-bad-params.rs @@ -1,3 +1,5 @@ +#![allow(unused_variables)] + #[macro_use] extern crate rocket; use rocket::http::CookieJar; diff --git a/core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs b/core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs index 2d0105b1..6c5c94e3 100644 --- a/core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs +++ b/core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs @@ -3,8 +3,8 @@ #[get("/")] fn index() { } -#[post("//")] -fn simple(id: i32, name: String) -> &'static str { "" } +#[post("/<_id>/<_name>")] +fn simple(_id: i32, _name: String) -> &'static str { "" } fn main() { uri!(simple: id = 100, "Hello"); diff --git a/scripts/test.sh b/scripts/test.sh index 257fc759..3a77b5ce 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -184,7 +184,7 @@ function test_default() { function test_ui() { echo ":: Testing compile-time UI output..." - indir "${PROJECT_ROOT}" $CARGO test ui --all --all-features -- --ignored $@ + indir "${PROJECT_ROOT}" $CARGO test --test ui-fail --all --all-features -- --ignored $@ } function run_benchmarks() {