Skip to content

Conversation

@JonathanBrouwer
Copy link
Contributor

WIP

@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 24, 2026
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat2 ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#fat3 ... ok
test [ui] tests/ui/extern/issue-80074.rs ... ok
test [ui] tests/ui/extern/issue-95829.rs ... ok
test [ui] tests/ui/extern/lgamma-linkage.rs ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin1 ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
---
test [ui] tests/ui/imports/ambiguous-2.rs ... ok
test [ui] tests/ui/imports/ambiguous-4.rs ... ok
test [ui] tests/ui/imports/ambiguous-7.rs ... ok
test [ui] tests/ui/imports/ambiguous-9.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.rs ... ok
test [ui] tests/ui/imports/ambiguous-8.rs ... ok
test [ui] tests/ui/imports/ambiguous-glob-vs-expanded-extern.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-no-implicit-prelude.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-core-glob.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-non-prelude-std-glob.rs ... ok
---

4 LL | #[diag(no_crate_example, code = E0123)]
5    | ^
6 
- error: derive(Diagnostic): diagnostic slug not specified
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
8   --> $DIR/diagnostic-derive.rs:50:5
9    |
10 LL |     Foo,

11    |     ^^^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
14 
- error: derive(Diagnostic): diagnostic slug not specified
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
16   --> $DIR/diagnostic-derive.rs:52:5
17    |
18 LL |     Bar,

19    |     ^^^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
22 
23 error: derive(Diagnostic): `#[nonsense(...)]` is not a valid attribute
24   --> $DIR/diagnostic-derive.rs:63:1

26 LL | #[nonsense(no_crate_example, code = E0123)]
27    | ^
28 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:63:1
-    |
- LL | #[nonsense(no_crate_example, code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:70:1
-    |
- LL | #[diag(code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
- error: derive(Diagnostic): diagnostic slug must be the first argument
-   --> $DIR/diagnostic-derive.rs:80:16
-    |
- LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
-    |                ^
- 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:80:1
-    |
- LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
59 error: derive(Diagnostic): unknown argument
-   --> $DIR/diagnostic-derive.rs:86:8
-    |
- LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
-    |        ^^^^^^^^
-    |
-    = note: only the `code` parameter is valid after the slug
- 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:86:1
-    |
- LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
- error: derive(Diagnostic): unknown argument
-   --> $DIR/diagnostic-derive.rs:92:8
-    |
- LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
-    |        ^^^^^^^^
-    |
-    = note: only the `code` parameter is valid after the slug
- 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:92:1
-    |
- LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
- error: derive(Diagnostic): unknown argument
92   --> $DIR/diagnostic-derive.rs:98:40
93    |
94 LL | #[diag(no_crate_example, code = E0123, slug = "foo")]

103    |     ^
104 
105 error: derive(Diagnostic): attribute specified multiple times
-   --> $DIR/diagnostic-derive.rs:112:8
---
- 
- error: derive(Diagnostic): attribute specified multiple times
130   --> $DIR/diagnostic-derive.rs:118:40
131    |
132 LL | #[diag(no_crate_example, code = E0123, code = E0456)]

138 LL | #[diag(no_crate_example, code = E0123, code = E0456)]
139    |                          ^^^^
140 
- error: derive(Diagnostic): diagnostic slug must be the first argument
-   --> $DIR/diagnostic-derive.rs:123:43
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
+   --> $DIR/diagnostic-derive.rs:128:8
143    |
- LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
-    |                                           ^
- 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:128:1
-    |
150 LL | struct KindNotProvided {}
-    | ^^^^^^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
+    |        ^^^^^^^^^^^^^^^
154 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:131:1
-    |
- LL | #[diag(code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
163 error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
164   --> $DIR/diagnostic-derive.rs:142:5
165    |

336 LL | #[error(no_crate_example, code = E0123)]
337    | ^
338 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:583:1
-    |
- LL | #[error(no_crate_example, code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
347 error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
348   --> $DIR/diagnostic-derive.rs:590:1
349    |

350 LL | #[warn_(no_crate_example, code = E0123)]
351    | ^
352 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:590:1
-    |
- LL | #[warn_(no_crate_example, code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
361 error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
362   --> $DIR/diagnostic-derive.rs:597:1
363    |

364 LL | #[lint(no_crate_example, code = E0123)]
365    | ^
366 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:597:1
-    |
- LL | #[lint(no_crate_example, code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
375 error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
376   --> $DIR/diagnostic-derive.rs:604:1
377    |

378 LL | #[lint(no_crate_example, code = E0123)]
379    | ^
380 
- error: derive(Diagnostic): diagnostic slug not specified
-   --> $DIR/diagnostic-derive.rs:604:1
-    |
- LL | #[lint(no_crate_example, code = E0123)]
-    | ^
-    |
-    = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
- 
389 error: derive(Diagnostic): attribute specified multiple times
390   --> $DIR/diagnostic-derive.rs:613:53
391    |

428    |
429    = help: consider creating a `Subdiagnostic` instead
430 
- error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
-   --> $DIR/diagnostic-derive.rs:647:1
-    |
- LL | #[multipart_suggestion()]
-    | ^
-    |
-    = help: consider creating a `Subdiagnostic` instead
- 
- error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
-   --> $DIR/diagnostic-derive.rs:651:5
-    |
- LL |     #[multipart_suggestion(no_crate_suggestion)]
-    |     ^
-    |
-    = help: consider creating a `Subdiagnostic` instead
- 
- error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
-   --> $DIR/diagnostic-derive.rs:659:1
-    |
- LL | #[suggestion(no_crate_suggestion, code = "...")]
-    | ^
-    |
-    = help: `#[label]` and `#[suggestion]` can only be applied to fields
- 
- error: derive(Diagnostic): `#[label]` is not a valid attribute
-   --> $DIR/diagnostic-derive.rs:668:1
-    |
- LL | #[label]
-    | ^
-    |
-    = help: `#[label]` and `#[suggestion]` can only be applied to fields
- 
463 error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
464   --> $DIR/diagnostic-derive.rs:702:5
465    |

531    |        ^ you might be missing crate `core`
532 
---
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:80:16
+    |
+ LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
+    |                ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:86:17
+    |
+ LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
+    |                 ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:92:17
+    |
+ LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
+    |                 ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:98:47
+    |
+ LL | #[diag(no_crate_example, code = E0123, slug = "foo")]
+    |                                               ^^^^^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:123:43
+    |
+ LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
+    |                                           ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:131:13
+    |
+ LL | #[diag(code = E0123)]
+    |             ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
534   --> $DIR/diagnostic-derive.rs:802:23
535    |
536 LL |     #[suggestion(code(foo))]

670    = note: in this macro invocation
671    = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
672 
- error: aborting due to 85 previous errors
---
+    |          ^^^^^^^^^^
+    |
+    = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
674 
- Some errors have detailed explanations: E0277, E0425, E0433.
+ error[E0599]: no method named `label` found for struct `Diag<'_, _>` in the current scope
+   --> $DIR/diagnostic-derive.rs:666:10
+    |
+ LL | #[derive(Diagnostic)]
+    |          ^^^^^^^^^^
+    |
---
-   --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:123:43
-   --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:131:13
-   --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:657:10
-   --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:666:10
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
+   --> $DIR/diagnostic-derive.rs:112:3
+    |   ^^^^
+   --> $DIR/diagnostic-derive.rs:111:3
+    |   ^^^^
+ error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
+   --> $DIR/diagnostic-derive.rs:128:8
+    |        ^^^^^^^^^^^^^^^
+   --> $DIR/diagnostic-derive.rs:70:13
+    |
+ LL | #[diag(code = E0123)]
+    |             ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:80:16
+    |
+ LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
+    |                ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:86:17
+    |
+ LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
+    |                 ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:92:17
+    |
+ LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
+    |                 ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:98:47
+    |
+ LL | #[diag(no_crate_example, code = E0123, slug = "foo")]
+    |                                               ^^^^^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:123:43
+    |
+ LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
+    |                                           ^ you might be missing crate `core`
+ 
+ error[E0433]: failed to resolve: you might be missing crate `core`
+   --> $DIR/diagnostic-derive.rs:131:13
+    |
+ LL | #[diag(code = E0123)]
---
+    |
+ LL | #[derive(Diagnostic)]
+    |          ^^^^^^^^^^
+    |
+    = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)
+ error[E0599]: no method named `label` found for struct `Diag<'_, _>` in the current scope
+   --> $DIR/diagnostic-derive.rs:666:10
+    |
+ LL | #[derive(Diagnostic)]
+    |          ^^^^^^^^^^
+    |
---
To only update this specific test, also pass `--test-args session-diagnostic/diagnostic-derive.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: derive(Diagnostic): unsupported type attribute for diagnostic derive enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:47:1
   |
LL | #[diag(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:50:5
   |
LL |     Foo,
   |     ^^^

error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:52:5
   |
LL |     Bar,
   |     ^^^

error: derive(Diagnostic): `#[nonsense(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:63:1
   |
LL | #[nonsense(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): unknown argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:98:40
   |
LL | #[diag(no_crate_example, code = E0123, slug = "foo")]
   |                                        ^^^^
   |
   = note: only the `code` parameter is valid after the slug

error: derive(Diagnostic): `#[suggestion = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:105:5
   |
LL |     #[suggestion = "bar"]
   |     ^

---

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:118:40
   |
LL | #[diag(no_crate_example, code = E0123, code = E0456)]
   |                                        ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:118:26
   |
LL | #[diag(no_crate_example, code = E0123, code = E0456)]
   |                          ^^^^

error: derive(Diagnostic): Missing `#[diag]` attribute on diagnostic
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:128:8
   |
LL | struct KindNotProvided {} //~ ERROR diagnostic slug not specified
   |        ^^^^^^^^^^^^^^^

error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:142:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): `#[nonsense]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:150:5
   |
LL |     #[nonsense]
   |     ^

error: derive(Diagnostic): the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:167:5
   |
LL |     #[label(no_crate_label)]
   |     ^

error: derive(Diagnostic): `name` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:175:46
   |
LL |     #[suggestion(no_crate_suggestion, code = "{name}")]
   |                                              ^^^^^^^^

error: invalid format string: expected `}` but string was terminated
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:180:10
   |
LL | #[derive(Diagnostic)]
   |          ^^^^^^^^^^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: invalid format string: unmatched `}` found
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:190:10
   |
LL | #[derive(Diagnostic)]
   |          ^^^^^^^^^^ unmatched `}` in format string
   |
   = note: if you intended to print `}`, you can escape it using `}}`
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: derive(Diagnostic): the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:210:5
   |
LL |     #[label(no_crate_label)]
   |     ^

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:229:5
   |
LL |     #[suggestion(no_crate_suggestion)]
   |     ^

---
   |                  ^^^^^^^^
   |
   = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:237:5
   |
LL |     #[suggestion(nonsense = "bar")]
   |     ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:246:18
   |
LL |     #[suggestion(msg = "bar")]
   |                  ^^^
   |
   = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:246:5
   |
LL |     #[suggestion(msg = "bar")]
   |     ^

error: derive(Diagnostic): wrong field type for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:269:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "This is suggested code")]
   |     ^
   |
   = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:285:24
   |
LL |     suggestion: (Span, Span, Applicability),
---
   |
LL |     suggestion: (Applicability, Applicability, Span),
   |                  ^^^^^^^^^^^^^

error: derive(Diagnostic): `#[label = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:300:5
   |
LL |     #[label = "bar"]
   |     ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:451:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
   |     ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:453:24
   |
LL |     suggestion: (Span, Applicability),
   |                        ^^^^^^^^^^^^^

error: derive(Diagnostic): invalid applicability
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:459:69
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
   |                                                                     ^^^^^^^^

error: derive(Diagnostic): the `#[help(...)]` attribute can only be applied to fields of type `Span`, `MultiSpan`, `bool` or `()`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:526:5
   |
LL |     #[help(no_crate_help)]
   |     ^

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:535:32
   |
LL |     #[label(no_crate_label, foo)]
   |                                ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:543:29
   |
LL |     #[label(no_crate_label, foo = "...")]
   |                             ^^^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:551:29
   |
LL |     #[label(no_crate_label, foo("..."))]
   |                             ^^^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:563:5
   |
LL |     #[primary_span]
   |     ^
   |
   = help: the `primary_span` field attribute is not valid for lint diagnostics

error: derive(Diagnostic): `#[error(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:583:1
   |
LL | #[error(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:590:1
   |
LL | #[warn_(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:597:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:604:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:613:53
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
   |                                                     ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:613:39
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
   |                                       ^^^^

error: derive(Diagnostic): wrong types for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:622:24
   |
LL |     suggestion: (Span, usize),
   |                        ^^^^^
   |
   = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`

error: derive(Diagnostic): wrong types for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:630:17
   |
LL |     suggestion: (Span,),
   |                 ^^^^^^^
   |
   = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:637:5
   |
LL |     #[suggestion(no_crate_suggestion)]
   |     ^

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:644:1
   |
LL | #[multipart_suggestion(no_crate_suggestion)]
   | ^
   |
   = help: consider creating a `Subdiagnostic` instead

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:702:5
   |
LL |     #[subdiagnostic(bad)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:710:5
   |
LL |     #[subdiagnostic = "bad"]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:718:5
   |
LL |     #[subdiagnostic(bad, bad)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:726:5
   |
LL |     #[subdiagnostic("bad")]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:734:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:742:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:763:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): expected at least one string literal for `code(...)`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:794:23
   |
LL |     #[suggestion(code())]
   |                       ^

error: derive(Diagnostic): `code(...)` must contain only string literals
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:802:23
   |
LL |     #[suggestion(code(foo))]
   |                       ^^^

error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:826:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "")]
   |     ^
   |
   = note: `#[suggestion(...)]` applied to `Vec` field is ambiguous
   = 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: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:58:8
   |
LL | #[diag = "E0123"]
---

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:80:16
   |
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
   |                ^ you might be missing crate `core`

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:86:17
   |
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
   |                 ^ you might be missing crate `core`

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:92:17
   |
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
   |                 ^ you might be missing crate `core`

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:98:47
   |
LL | #[diag(no_crate_example, code = E0123, slug = "foo")]
   |                                               ^^^^^ you might be missing crate `core`

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:123:43
   |
LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
---

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:802:23
   |
LL |     #[suggestion(code(foo))]
   |                       ^^^ you might be missing crate `core`

error[E0433]: failed to resolve: you might be missing crate `core`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:811:25
   |
LL |     #[suggestion(code = 3)]
   |                         ^ you might be missing crate `core`

error: cannot find attribute `nonsense` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:63:3
   |
LL | #[nonsense(no_crate_example, code = E0123)]
   |   ^^^^^^^^

error: cannot find attribute `nonsense` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:150:7
   |
LL |     #[nonsense]
   |       ^^^^^^^^

error: cannot find attribute `error` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:583:3
   |
LL | #[error(no_crate_example, code = E0123)]
   |   ^^^^^
   |
help: `error` is an attribute that can be used by the derive macro `Error`, you might be missing a `derive` attribute
   |
LL + #[derive(Error)]
LL | struct ErrorAttribute {}
   |

error: cannot find attribute `warn_` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:590:3
   |
LL | #[warn_(no_crate_example, code = E0123)]
   |   ^^^^^
   |
help: a built-in attribute with a similar name exists
   |
LL - #[warn_(no_crate_example, code = E0123)]
LL + #[warn(no_crate_example, code = E0123)]
   |

error: cannot find attribute `lint` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:597:3
   |
LL | #[lint(no_crate_example, code = E0123)]
   |   ^^^^
   |
help: a built-in attribute with a similar name exists
   |
LL - #[lint(no_crate_example, code = E0123)]
LL + #[link(no_crate_example, code = E0123)]
   |

error: cannot find attribute `lint` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:604:3
   |
LL | #[lint(no_crate_example, code = E0123)]
   |   ^^^^
   |
help: a built-in attribute with a similar name exists
   |
LL - #[lint(no_crate_example, code = E0123)]
LL + #[link(no_crate_example, code = E0123)]
   |

error: cannot find attribute `multipart_suggestion` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:644:3
   |
---

error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:75:8
   |
LL | #[diag(nonsense, code = E0123)]
   |        ^^^^^^^^ not found in `crate::fluent_generated`

error[E0425]: cannot find value `__code_34` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:808:10
   |
LL | #[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` in this scope
   |          ^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Hello: IntoDiagArg` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:349:12
   |
LL | #[derive(Diagnostic)]
   |          ---------- required by a bound introduced by this call
...
---
             AllocRange
             Backtrace
             Binder<I, T>
           and 74 others
note: required by a bound in `Diag::<'a, G>::arg`
  --> /rustc/FAKE_PREFIX/compiler/rustc_errors/src/diagnostic.rs:525:8
  ::: /rustc/FAKE_PREFIX/compiler/rustc_errors/src/diagnostic.rs:1257:7
   |
   = note: in this macro invocation
   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
---
   |          ^^^^^^^^^^
   |
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `label` found for struct `Diag<'_, _>` in the current scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:666:10
   |
LL | #[derive(Diagnostic)]
   |          ^^^^^^^^^^
   |

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants