Skip to content

Commit

Permalink
Update to syn 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Mar 24, 2023
1 parent adda7f9 commit 246e55d
Show file tree
Hide file tree
Showing 61 changed files with 660 additions and 589 deletions.
2 changes: 1 addition & 1 deletion diesel_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ diffy = "0.3.0"
regex = "1.0.6"
serde_regex = "1.1"
diesel_table_macro_syntax = {version = "0.1", path = "../diesel_table_macro_syntax"}
syn = { version = "1", features = ["visit"] }
syn = { version = "2", features = ["visit"] }

[dependencies.diesel]
version = "~2.0.0"
Expand Down
70 changes: 28 additions & 42 deletions diesel_compile_tests/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
note: `#[derive(AsChangeset)]` never changes the primary key of a row.
--> tests/fail/derive/as_changeset_struct_with_only_primary_key.rs:18:10
|
18 | #[derive(AsChangeset)]
| ^^^^^^^^^^^
|
= help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
= note: `#[derive(AsChangeset)]` never changes the primary key of a row.
= note: this error originates in the derive macro `AsChangeset` (in Nightly builds, run with -Z macro-backtrace for more info)

error: Deriving `AsChangeset` on a structure that only contains primary keys isn't supported.
help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
note: `#[derive(AsChangeset)]` never changes the primary key of a row.
--> tests/fail/derive/as_changeset_struct_with_only_primary_key.rs:24:10
|
24 | #[derive(AsChangeset)]
| ^^^^^^^^^^^
|
= help: If you want to change the primary key of a row, you should do so with `.set(table::id.eq(new_id))`.
= note: `#[derive(AsChangeset)]` never changes the primary key of a row.
= note: this error originates in the derive macro `AsChangeset` (in Nightly builds, run with -Z macro-backtrace for more info)
6 changes: 2 additions & 4 deletions diesel_compile_tests/tests/fail/derive/bad_belongs_to.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
error: unexpected end of input, expected parentheses
help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
--> tests/fail/derive/bad_belongs_to.rs:29:20
|
29 | #[diesel(belongs_to)]
| ^
|
= help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`

error: expected parentheses
--> tests/fail/derive/bad_belongs_to.rs:36:21
Expand All @@ -31,12 +30,11 @@ error: expected `,`
| ^

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`
--> tests/fail/derive/bad_belongs_to.rs:64:37
|
64 | #[diesel(belongs_to(Bar, foreign_key))]
| ^
|
= help: The correct format looks like `#[diesel(belongs_to(Foo, foreign_key = foo_id))]`

error: expected `=`
--> tests/fail/derive/bad_belongs_to.rs:71:37
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(column_name = foo)]`
--> tests/fail/derive/bad_column_name.rs:16:25
|
16 | #[diesel(column_name)]
| ^
|
= help: The correct format looks like `#[diesel(column_name = foo)]`

error: expected `=`
--> tests/fail/derive/bad_column_name.rs:23:25
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(deserialize_as = Foo)]`
--> tests/fail/derive/bad_deserialize_as.rs:7:28
|
7 | #[diesel(deserialize_as)]
| ^
|
= help: The correct format looks like `#[diesel(deserialize_as = Foo)]`

error: expected `=`
--> tests/fail/derive/bad_deserialize_as.rs:14:28
Expand Down
9 changes: 3 additions & 6 deletions diesel_compile_tests/tests/fail/derive/bad_mysql_type.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
error: unexpected end of input, expected parentheses
help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
--> tests/fail/derive/bad_mysql_type.rs:6:20
|
6 | #[diesel(mysql_type)]
| ^
|
= help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`

error: expected attribute `name`
help: The correct format looks like #[diesel(mysql_type(name = "foo"))]
--> tests/fail/derive/bad_mysql_type.rs:10:21
|
10 | #[diesel(mysql_type())]
| ^
|
= help: The correct format looks like #[diesel(mysql_type(name = "foo"))]

error: expected parentheses
--> tests/fail/derive/bad_mysql_type.rs:14:21
Expand All @@ -21,12 +19,11 @@ error: expected parentheses
| ^

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`
--> tests/fail/derive/bad_mysql_type.rs:18:25
|
18 | #[diesel(mysql_type(name))]
| ^
|
= help: The correct format looks like `#[diesel(mysql_type(name = "foo"))]`

error: expected `=`
--> tests/fail/derive/bad_mysql_type.rs:22:25
Expand Down
30 changes: 10 additions & 20 deletions diesel_compile_tests/tests/fail/derive/bad_postgres_type.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
error: unexpected end of input, expected parentheses
help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
--> tests/fail/derive/bad_postgres_type.rs:6:23
|
6 | #[diesel(postgres_type)]
| ^
|
= help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`

error: expected `oid` and `array_oid` attribute or `name` attribute
help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:10:24
|
10 | #[diesel(postgres_type())]
| ^
|
= help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`

error: expected parentheses
--> tests/fail/derive/bad_postgres_type.rs:14:24
Expand All @@ -21,12 +19,11 @@ error: expected parentheses
| ^

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
--> tests/fail/derive/bad_postgres_type.rs:18:28
|
18 | #[diesel(postgres_type(name))]
| ^
|
= help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`

error: expected `=`
--> tests/fail/derive/bad_postgres_type.rs:22:28
Expand All @@ -41,28 +38,25 @@ error: expected string literal
| ^^^

error: unexpected `oid` when `name` is present
help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:30:38
|
30 | #[diesel(postgres_type(name = "foo", oid = 2, array_oid = 3))]
| ^^^
|
= help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`

error: unexpected `array_oid` when `name` is present
help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:34:38
|
34 | #[diesel(postgres_type(name = "foo", array_oid = 3))]
| ^^^^^^^^^
|
= help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`

error: expected `oid` and `array_oid` attribute or `name` attribute
help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:38:31
|
38 | #[diesel(postgres_type(oid = 2))]
| ^
|
= help: The correct format looks like either `#[diesel(postgres_type(name = "foo", schema = "public"))]` or `#[diesel(postgres_type(oid = 37, array_oid = 54))]`

error: expected integer literal
--> tests/fail/derive/bad_postgres_type.rs:42:45
Expand All @@ -77,12 +71,11 @@ error: expected integer literal
| ^^^

error: expected `name` to be also present
help: make sure `name` is present, `#[diesel(postgres_type(name = "...", schema = "foo"))]`
--> tests/fail/derive/bad_postgres_type.rs:50:24
|
50 | #[diesel(postgres_type(schema = "foo"))]
| ^^^^^^
|
= help: make sure `name` is present, `#[diesel(postgres_type(name = "...", schema = "foo"))]`

error: unknown attribute, expected one of `oid`, `array_oid`, `name`, `schema`
--> tests/fail/derive/bad_postgres_type.rs:54:24
Expand All @@ -91,25 +84,22 @@ error: unknown attribute, expected one of `oid`, `array_oid`, `name`, `schema`
| ^^^^

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`
--> tests/fail/derive/bad_postgres_type.rs:58:30
|
58 | #[diesel(postgres_type(schema))]
| ^
|
= help: The correct format looks like `#[diesel(postgres_type(name = "foo", schema = "public"))]`

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:62:27
|
62 | #[diesel(postgres_type(oid))]
| ^
|
= help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`

error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
--> tests/fail/derive/bad_postgres_type.rs:66:33
|
66 | #[diesel(postgres_type(array_oid))]
| ^
|
= help: The correct format looks like `#[diesel(postgres_type(oid = 37, array_oid = 54))]`
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ error: expected `,`
| ^

error: unexpected end of input, expected parentheses
help: The correct format looks like `#[diesel(key1, key2)]`
--> tests/fail/derive/bad_primary_key.rs:26:21
|
26 | #[diesel(primary_key)]
| ^
|
= help: The correct format looks like `#[diesel(key1, key2)]`

error: expected parentheses
--> tests/fail/derive/bad_primary_key.rs:33:22
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
error: unexpected end of input, expected `=`
help: The correct format looks like `#[diesel(serialize_as = Foo)]`
--> tests/fail/derive/bad_serialize_as.rs:15:26
|
15 | #[diesel(serialize_as)]
| ^
|
= help: The correct format looks like `#[diesel(serialize_as = Foo)]`

error: expected `=`
--> tests/fail/derive/bad_serialize_as.rs:23:26
Expand Down
Loading

0 comments on commit 246e55d

Please sign in to comment.