From cf325e8187f457b636973a31a83f279e455c25c2 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 25 Jul 2023 12:56:34 +0000 Subject: [PATCH] Bump syn now that it doesn't affect diagnostics anymore --- Cargo.lock | 38 +++--- compiler/rustc_macros/Cargo.toml | 3 +- .../diagnostic-derive.stderr | 52 +++---- .../subdiagnostic-derive.stderr | 127 +++++++++--------- 4 files changed, 109 insertions(+), 111 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c2c3f5e628b4..569010d08c5b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,7 +220,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -502,7 +502,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -527,7 +527,7 @@ dependencies = [ "regex", "rustc_tools_util", "serde", - "syn 2.0.8", + "syn 2.0.27", "tempfile", "termize", "tester", @@ -842,7 +842,7 @@ version = "0.1.73" dependencies = [ "itertools", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -943,7 +943,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -1309,7 +1309,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -2456,7 +2456,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -2643,7 +2643,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -3584,7 +3584,7 @@ dependencies = [ "fluent-syntax", "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", "unic-langid", ] @@ -3854,7 +3854,7 @@ version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", "synstructure 0.13.0", ] @@ -4462,7 +4462,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -4629,7 +4629,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -4910,9 +4910,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.8" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -4939,7 +4939,7 @@ checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", "unicode-xid", ] @@ -5089,7 +5089,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -5310,7 +5310,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", ] [[package]] @@ -5740,7 +5740,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -5774,7 +5774,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.8", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/compiler/rustc_macros/Cargo.toml b/compiler/rustc_macros/Cargo.toml index 16c4a850012b1..17651ce959879 100644 --- a/compiler/rustc_macros/Cargo.toml +++ b/compiler/rustc_macros/Cargo.toml @@ -8,7 +8,6 @@ proc-macro = true [dependencies] synstructure = "0.13.0" -# FIXME(Nilstrieb): Updating this causes changes in the diagnostics output. -syn = { version = "=2.0.8", features = ["full"] } +syn = { version = "2.0.9", features = ["full"] } proc-macro2 = "1" quote = "1" diff --git a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr index 1398f9c96bf20..ca09f1f0153f2 100644 --- a/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr +++ b/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr @@ -20,12 +20,6 @@ LL | Bar, | = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]` -error: expected parentheses: #[diag(...)] - --> $DIR/diagnostic-derive.rs:55:8 - | -LL | #[diag = "E0123"] - | ^ - error: `#[nonsense(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:60:1 | @@ -476,6 +470,14 @@ LL | #[multipart_suggestion(no_crate_suggestion)] | = help: consider creating a `Subdiagnostic` instead +error: `#[multipart_suggestion(...)]` is not a valid attribute + --> $DIR/diagnostic-derive.rs:645:1 + | +LL | #[multipart_suggestion()] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider creating a `Subdiagnostic` instead + error: `#[multipart_suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:649:5 | @@ -484,12 +486,6 @@ LL | #[multipart_suggestion(no_crate_suggestion)] | = help: consider creating a `Subdiagnostic` instead -error: unexpected end of input, unexpected token in nested attribute, expected ident - --> $DIR/diagnostic-derive.rs:645:24 - | -LL | #[multipart_suggestion()] - | ^ - error: `#[suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:657:1 | @@ -550,18 +546,6 @@ error: `code(...)` must contain only string literals LL | #[suggestion(code(foo))] | ^^^ -error: unexpected token - --> $DIR/diagnostic-derive.rs:798:23 - | -LL | #[suggestion(code(foo))] - | ^^^ - -error: expected string literal - --> $DIR/diagnostic-derive.rs:807:25 - | -LL | #[suggestion(code = 3)] - | ^ - error: `#[suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:822:5 | @@ -572,6 +556,24 @@ LL | #[suggestion(no_crate_suggestion, code = "")] = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]` = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]` +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/diagnostic-derive.rs:55:8 + | +LL | #[diag = "E0123"] + | ^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/diagnostic-derive.rs:798:23 + | +LL | #[suggestion(code(foo))] + | ^^^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/diagnostic-derive.rs:807:25 + | +LL | #[suggestion(code = 3)] + | ^ maybe a missing crate `core`? + error: cannot find attribute `nonsense` in this scope --> $DIR/diagnostic-derive.rs:60:3 | @@ -656,5 +658,5 @@ note: required by a bound in `DiagnosticBuilder::<'a, G>::set_arg` error: aborting due to 84 previous errors -Some errors have detailed explanations: E0277, E0425. +Some errors have detailed explanations: E0277, E0425, E0433. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr index 5ddc8edd745db..1dedd68914e3c 100644 --- a/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr +++ b/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr @@ -38,12 +38,6 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute LL | #[label(bug = "...")] | ^^^^^^^^^^^^^^^^^^^^^ -error: unexpected literal in nested attribute, expected ident - --> $DIR/subdiagnostic-derive.rs:97:9 - | -LL | #[label("...")] - | ^^^^^ - error: only `no_span` is a valid nested attribute --> $DIR/subdiagnostic-derive.rs:106:9 | @@ -68,11 +62,11 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute LL | #[label(slug("..."))] | ^^^^^^^^^^^^^^^^^^^^^ -error: unexpected end of input, unexpected token in nested attribute, expected ident - --> $DIR/subdiagnostic-derive.rs:136:9 +error: diagnostic slug must be first argument of a `#[label(...)]` attribute + --> $DIR/subdiagnostic-derive.rs:136:1 | LL | #[label()] - | ^ + | ^^^^^^^^^^ error: only `no_span` is a valid nested attribute --> $DIR/subdiagnostic-derive.rs:145:27 @@ -174,16 +168,6 @@ LL | #[bar("...")] | = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes -error: unexpected unsupported untagged union - --> $DIR/subdiagnostic-derive.rs:312:1 - | -LL | / union AC { -LL | | -LL | | span: u32, -LL | | b: u64, -LL | | } - | |_^ - error: a diagnostic slug must be the first argument to the attribute --> $DIR/subdiagnostic-derive.rs:327:44 | @@ -331,11 +315,11 @@ error: `#[suggestion_part(...)]` attribute without `code = "..."` LL | #[suggestion_part] | ^^^^^^^^^^^^^^^^^^ -error: unexpected end of input, unexpected token in nested attribute, expected ident - --> $DIR/subdiagnostic-derive.rs:558:23 +error: `#[suggestion_part(...)]` attribute without `code = "..."` + --> $DIR/subdiagnostic-derive.rs:558:5 | LL | #[suggestion_part()] - | ^ + | ^^^^^^^^^^^^^^^^^^^^ error: `#[primary_span]` is not a valid attribute --> $DIR/subdiagnostic-derive.rs:567:5 @@ -363,6 +347,12 @@ error: `#[suggestion_part(...)]` attribute without `code = "..."` LL | #[suggestion_part] | ^^^^^^^^^^^^^^^^^^ +error: `#[suggestion_part(...)]` attribute without `code = "..."` + --> $DIR/subdiagnostic-derive.rs:578:5 + | +LL | #[suggestion_part()] + | ^^^^^^^^^^^^^^^^^^^^ + error: `code` is the only valid nested attribute --> $DIR/subdiagnostic-derive.rs:581:23 | @@ -381,18 +371,6 @@ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of LL | #[suggestion_part()] | ^^^^^^^^^^^^^^^^^^^^ -error: unexpected end of input, unexpected token in nested attribute, expected ident - --> $DIR/subdiagnostic-derive.rs:578:23 - | -LL | #[suggestion_part()] - | ^ - -error: expected `,` - --> $DIR/subdiagnostic-derive.rs:581:27 - | -LL | #[suggestion_part(foo = "bar")] - | ^ - error: specified multiple times --> $DIR/subdiagnostic-derive.rs:596:37 | @@ -417,48 +395,24 @@ error: expected exactly one string literal for `code = ...` LL | #[suggestion_part(code("foo"))] | ^ -error: unexpected token - --> $DIR/subdiagnostic-derive.rs:673:28 - | -LL | #[suggestion_part(code("foo"))] - | ^^^^^ - error: expected exactly one string literal for `code = ...` --> $DIR/subdiagnostic-derive.rs:683:41 | LL | #[suggestion_part(code("foo", "bar"))] | ^ -error: unexpected token - --> $DIR/subdiagnostic-derive.rs:683:28 - | -LL | #[suggestion_part(code("foo", "bar"))] - | ^^^^^ - error: expected exactly one string literal for `code = ...` --> $DIR/subdiagnostic-derive.rs:693:30 | LL | #[suggestion_part(code(3))] | ^ -error: unexpected token - --> $DIR/subdiagnostic-derive.rs:693:28 - | -LL | #[suggestion_part(code(3))] - | ^ - error: expected exactly one string literal for `code = ...` --> $DIR/subdiagnostic-derive.rs:703:29 | LL | #[suggestion_part(code())] | ^ -error: expected string literal - --> $DIR/subdiagnostic-derive.rs:715:30 - | -LL | #[suggestion_part(code = 3)] - | ^ - error: specified multiple times --> $DIR/subdiagnostic-derive.rs:757:1 | @@ -513,12 +467,6 @@ error: expected `= "xxx"` LL | #[suggestion(no_crate_example, code = "", style("foo"))] | ^ -error: expected `,` - --> $DIR/subdiagnostic-derive.rs:806:48 - | -LL | #[suggestion(no_crate_example, code = "", style("foo"))] - | ^ - error: `#[primary_span]` is not a valid attribute --> $DIR/subdiagnostic-derive.rs:818:5 | @@ -540,6 +488,54 @@ LL | | sub: Vec, LL | | } | |_^ +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:97:9 + | +LL | #[label("...")] + | ^^^^^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:312:1 + | +LL | union AC { + | ^^^^^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:581:27 + | +LL | #[suggestion_part(foo = "bar")] + | ^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:673:28 + | +LL | #[suggestion_part(code("foo"))] + | ^^^^^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:683:28 + | +LL | #[suggestion_part(code("foo", "bar"))] + | ^^^^^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:693:28 + | +LL | #[suggestion_part(code(3))] + | ^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:715:30 + | +LL | #[suggestion_part(code = 3)] + | ^ maybe a missing crate `core`? + +error[E0433]: failed to resolve: maybe a missing crate `core`? + --> $DIR/subdiagnostic-derive.rs:806:48 + | +LL | #[suggestion(no_crate_example, code = "", style("foo"))] + | ^ maybe a missing crate `core`? + error: cannot find attribute `foo` in this scope --> $DIR/subdiagnostic-derive.rs:68:3 | @@ -610,4 +606,5 @@ LL | #[derive(Subdiagnostic)] error: aborting due to 86 previous errors -For more information about this error, try `rustc --explain E0425`. +Some errors have detailed explanations: E0425, E0433. +For more information about an error, try `rustc --explain E0425`.