Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
error: invalid value: expected string literal
--> $DIR/database-syntax.rs:4:12
--> tests/ui-fail-nightly/database-syntax.rs:4:12
|
4 | #[database(123)]
| ^^^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:3:10
--> tests/ui-fail-nightly/database-syntax.rs:3:10
|
3 | #[derive(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-nightly/database-syntax.rs:8:25
|
8 | #[database("some-name", "another")]
| ^^^^^^^^^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:7:10
--> tests/ui-fail-nightly/database-syntax.rs:7:10
|
7 | #[derive(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-nightly/database-syntax.rs:12:25
|
12 | #[database("some-name", name = "another")]
| ^^^^^^^^^^^^^^^^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:11:10
--> tests/ui-fail-nightly/database-syntax.rs:11:10
|
11 | #[derive(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-nightly/database-syntax.rs:16:1
|
16 | / #[database("foo")]
17 | | enum D { }
| |___________^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:15:10
--> tests/ui-fail-nightly/database-syntax.rs:15:10
|
15 | #[derive(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-nightly/database-syntax.rs:20:1
|
20 | struct E(deadpool_postgres::Pool);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:19:10
--> tests/ui-fail-nightly/database-syntax.rs:19:10
|
19 | #[derive(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-nightly/database-syntax.rs:23:1
|
23 | / #[database("foo")]
24 | | struct F;
| |_________^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:22:10
--> tests/ui-fail-nightly/database-syntax.rs:22:10
|
22 | #[derive(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-nightly/database-syntax.rs:27:1
|
27 | / #[database("foo")]
28 | | struct G(deadpool_postgres::Pool, deadpool_postgres::Pool);
| |___________________________________________________________^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:26:10
--> tests/ui-fail-nightly/database-syntax.rs:26:10
|
26 | #[derive(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-nightly/database-syntax.rs:31:1
|
31 | / #[database("foo")]
32 | | struct H {
Expand All @@ -102,7 +102,7 @@ error: named structs are not supported
| |_^
|
note: error occurred while deriving `Database`
--> $DIR/database-syntax.rs:30:10
--> tests/ui-fail-nightly/database-syntax.rs:30:10
|
30 | #[derive(Database)]
| ^^^^^^^^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
error[E0277]: the trait bound `Unknown: Pool` is not satisfied
--> $DIR/database-types.rs:7:10
--> tests/ui-fail-nightly/database-types.rs:7:10
|
7 | struct A(Unknown);
| ^^^^^^^ the trait `Pool` is not implemented for `Unknown`
|
note: required by a bound in `rocket_db_pools::Database::Pool`
--> $DIR/database.rs:41:16
--> $WORKSPACE/contrib/db_pools/lib/src/database.rs
|
41 | type Pool: Pool;
| type Pool: Pool;
| ^^^^ required by this bound in `rocket_db_pools::Database::Pool`

error[E0277]: the trait bound `Vec<i32>: Pool` is not satisfied
--> $DIR/database-types.rs:11:10
--> tests/ui-fail-nightly/database-types.rs:11:10
|
11 | struct B(Vec<i32>);
| ^^^^^^^^ the trait `Pool` is not implemented for `Vec<i32>`
|
note: required by a bound in `rocket_db_pools::Database::Pool`
--> $DIR/database.rs:41:16
--> $WORKSPACE/contrib/db_pools/lib/src/database.rs
|
41 | type Pool: Pool;
| type Pool: Pool;
| ^^^^ required by this bound in `rocket_db_pools::Database::Pool`
Original file line number Diff line number Diff line change
@@ -1,111 +1,111 @@
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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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")]
| ^

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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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")]
| ^

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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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")]
| ^

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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (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")]
| ^

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)]
| ^^^^^^^^
|
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Unknown: Pool` is not satisfied
--> $DIR/database-types.rs:7:10
--> tests/ui-fail-stable/database-types.rs:7:10
|
7 | struct A(Unknown);
| ^^^^^^^ the trait `Pool` is not implemented for `Unknown`
Expand All @@ -10,7 +10,7 @@ error[E0277]: the trait bound `Unknown: Pool` is not satisfied
| ---- required by this bound in `rocket_db_pools::Database::Pool`

error[E0277]: the trait bound `Vec<i32>: Pool` is not satisfied
--> $DIR/database-types.rs:11:10
--> tests/ui-fail-stable/database-types.rs:11:10
|
11 | struct B(Vec<i32>);
| ^^^ the trait `Pool` is not implemented for `Vec<i32>`
Expand Down
5 changes: 5 additions & 0 deletions contrib/db_pools/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2018"

[package.metadata]
# minimum supported rust version 1.53.0 because of
# error[E0391]: cycle detected when computing the supertraits of `database::Database`
msrv = "1.53.0"

[package.metadata.docs.rs]
all-features = true

Expand Down
1 change: 1 addition & 0 deletions contrib/sync_db_pools/codegen/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct DatabaseInvocation {
/// The database name as passed in via #[database('database name')].
db_name: String,
/// The entire structure that the `database` attribute was called on.
#[allow(dead_code)]
structure: DataStruct,
/// The type inside the structure: struct MyDb(ThisType).
connection_type: Type,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
error: unexpected end of input, expected string literal
--> $DIR/database-syntax.rs:6:1
--> tests/ui-fail-nightly/database-syntax.rs:6:1
|
6 | #[database]
| ^^^^^^^^^^^
|
= note: this error originates in the attribute macro `database` (in Nightly builds, run with -Z macro-backtrace for more info)

error: expected string literal
--> $DIR/database-syntax.rs:9:12
--> tests/ui-fail-nightly/database-syntax.rs:9:12
|
9 | #[database(1)]
| ^

error: expected string literal
--> $DIR/database-syntax.rs:12:12
--> tests/ui-fail-nightly/database-syntax.rs:12:12
|
12 | #[database(123)]
| ^^^

error: unexpected token
--> $DIR/database-syntax.rs:15:20
--> tests/ui-fail-nightly/database-syntax.rs:15:20
|
15 | #[database("hello" "hi")]
| ^^^^

error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:19:1
--> tests/ui-fail-nightly/database-syntax.rs:19:1
|
19 | enum Foo { }
| ^^^^^^^^^^^^^

error: `database` attribute can only be applied to structs with exactly one unnamed field
--> $DIR/database-syntax.rs:22:11
--> tests/ui-fail-nightly/database-syntax.rs:22:11
|
22 | struct Bar(diesel::SqliteConnection, diesel::SqliteConnection);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: example: `struct MyDatabase(diesel::SqliteConnection);`

error: `database` attribute can only be used on structs
--> $DIR/database-syntax.rs:25:1
--> tests/ui-fail-nightly/database-syntax.rs:25:1
|
25 | union Baz { }
| ^^^^^^^^^^^^^^

error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:28:9
--> tests/ui-fail-nightly/database-syntax.rs:28:9
|
28 | struct E<'r>(&'r str);
| ^^^^

error: `database` attribute cannot be applied to structs with generics
--> $DIR/database-syntax.rs:31:9
--> tests/ui-fail-nightly/database-syntax.rs:31:9
|
31 | struct F<T>(T);
| ^^^
Loading