Skip to content

Unify wording of "failed to resolve" errors with "cannot find" resolution errors #128086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

estebank
Copy link
Contributor

  • Use the same wording for all macro resolution errors
  • specify the scope in which the resolution failure happened

Before

error[E0433]: failed to resolve: `crate` in paths can only be used in start position
  --> $DIR/crate-path-non-absolute.rs:5:22
   |
LL |         let s = ::m::crate::S;
   |                      ^^^^^ `crate` in paths can only be used in start position

after

error[E0433]: cannot find module `crate` in module `m`
  --> $DIR/crate-path-non-absolute.rs:5:22
   |
LL |         let s = ::m::crate::S;
   |                      ^^^^^ `crate` in paths can only be used in start position

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 23, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 23, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@estebank
Copy link
Contributor Author

Split off from #126810.

"Hide whitespace" will aid in seeing mostly "true" changes. The amount of files being touched is a consequence of the blast radius the diagnostic has.

Happy to hear about other potential alternatives for what the output should be instead.

@rust-log-analyzer

This comment has been minimized.

@petrochenkov
Copy link
Contributor

Blocking on the wording discussion in #128080 (comment).
@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 23, 2024
@bors

This comment was marked as resolved.

@lolbinarycat lolbinarycat added the A-diagnostics Area: Messages for errors, warnings, and lints label Sep 2, 2024
@petrochenkov
Copy link
Contributor

#128080 has landed, unblocking.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Blocked on something else such as an RFC or other implementation work. labels Apr 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 14, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@estebank estebank force-pushed the failed-to-resolve branch from 2abb31d to b32d0e7 Compare May 27, 2025 16:51
@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the failed-to-resolve branch from b32d0e7 to c397b99 Compare May 27, 2025 17:16
@rust-log-analyzer

This comment was marked as resolved.

@estebank estebank added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 27, 2025
…tion errors

* Use the same wording for all macro resolution errors
* specify the scope in which the resolution failure happened

Before

```
error[E0433]: failed to resolve: `crate` in paths can only be used in start position
  --> $DIR/crate-path-non-absolute.rs:5:22
   |
LL |         let s = ::m::crate::S;
   |                      ^^^^^ `crate` in paths can only be used in start position
```
after
```
error[E0433]: cannot find module `crate` in module `m`
  --> $DIR/crate-path-non-absolute.rs:5:22
   |
LL |         let s = ::m::crate::S;
   |                      ^^^^^ `crate` in paths can only be used in start position
```
@estebank estebank force-pushed the failed-to-resolve branch from c397b99 to fa24625 Compare May 27, 2025 19:13
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-19 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#19 exporting to docker image format
#19 sending tarball 20.3s done
#19 DONE 25.8s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--set', 'gcc.download-ci-gcc=true', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
---- [ui] tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive/diagnostic-derive.stderr`
diff of stderr:

524    = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
525    = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
526 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
528   --> $DIR/diagnostic-derive.rs:58:8
529    |
---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
534   --> $DIR/diagnostic-derive.rs:802:23
535    |
536 LL |     #[suggestion(code(foo))]

537    |                       ^^^ you might be missing crate `core`
538 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
540   --> $DIR/diagnostic-derive.rs:811:25
541    |
542 LL |     #[suggestion(code = 3)]


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
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/x86_64-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-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/x86_64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive" "-A" "unused" "-A" "internal_features" "-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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:50:5
   |
LL |     Foo,
   |     ^^^
   |
   = 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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:52:5
   |
LL |     Bar,
   |     ^^^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:80:16
   |
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
   |                ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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)]`

error: derive(Diagnostic): unknown argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[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:112:8
   |
---

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): diagnostic slug must be the first argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:123:43
   |
LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
   |                                           ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:128:1
   |
LL | struct KindNotProvided {} //~ ERROR diagnostic slug not specified
   | ^^^^^^
   |
   = 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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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)]`

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)]
   |     ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:237:18
   |
LL |     #[suggestion(nonsense = "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: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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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)]`

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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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)]`

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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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)]`

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): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:604:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`

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

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/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
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:668:1
   |
LL | #[label]
   | ^
   |
   = help: `#[label]` and `#[suggestion]` can only be applied to fields

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]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:58:8
   |
LL | #[diag = "E0123"]
   |        ^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:802:23
   |
LL |     #[suggestion(code(foo))]
   |                       ^^^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[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)]
   |   ^^^^^

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: `warn`

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)]
---

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
...
LL |     other: Hello,
   |            ^^^^^ the trait `IntoDiagArg` is not implemented for `Hello`
   |
   = help: the following other types implement trait `IntoDiagArg`:
             &'a T
             &'a std::path::Path
             &'a str
             &rustc_target::spec::TargetTuple
             AllocId
             AllocRange
             Backtrace
             Binder<I, T>
           and 71 others
note: required by a bound in `Diag::<'a, G>::arg`
  --> /rustc/FAKE_PREFIX/compiler/rustc_errors/src/diagnostic.rs:1276:5
   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 85 previous errors

---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
455   --> $DIR/subdiagnostic-derive.rs:96:9
456    |
457 LL | #[label("...")]

458    |         ^^^^^ you might be missing crate `core`
459 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
467   --> $DIR/subdiagnostic-derive.rs:582:27
468    |
469 LL |     #[suggestion_part(foo = "bar")]

470    |                           ^ you might be missing crate `core`
471 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
473   --> $DIR/subdiagnostic-derive.rs:675:28
474    |
475 LL |     #[suggestion_part(code("foo"))]

476    |                            ^^^^^ you might be missing crate `core`
477 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
479   --> $DIR/subdiagnostic-derive.rs:686:28
480    |
481 LL |     #[suggestion_part(code("foo", "bar"))]

482    |                            ^^^^^ you might be missing crate `core`
483 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
485   --> $DIR/subdiagnostic-derive.rs:697:28
486    |
487 LL |     #[suggestion_part(code(3))]

488    |                            ^ you might be missing crate `core`
489 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
491   --> $DIR/subdiagnostic-derive.rs:720:30
492    |
493 LL |     #[suggestion_part(code = 3)]

494    |                              ^ you might be missing crate `core`
495 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find item `core` in the crate root
497   --> $DIR/subdiagnostic-derive.rs:812:48
498    |
499 LL | #[suggestion(no_crate_example, code = "", style("foo"))]


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args session-diagnostic/subdiagnostic-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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-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/x86_64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: derive(Diagnostic): label without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:51:1
   |
LL | #[label(no_crate_example)]
   | ^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:58:1
   |
LL | #[label]
   | ^

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

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

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:86:9
   |
LL | #[label(bug = "...")]
   |         ^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:86:1
   |
LL | #[label(bug = "...")]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:106:9
   |
LL | #[label(slug = 4)]
   |         ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:106:1
   |
LL | #[label(slug = 4)]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:116:9
   |
LL | #[label(slug("..."))]
   |         ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:116:1
   |
LL | #[label(slug("..."))]
   | ^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:136:1
   |
LL | #[label()]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:145:27
   |
LL | #[label(no_crate_example, code = "...")]
   |                           ^^^^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:154:27
   |
LL | #[label(no_crate_example, applicability = "machine-applicable")]
   |                           ^^^^^^^^^^^^^

error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:163:1
   |
LL | #[foo]
   | ^

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

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

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

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

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:225:13
   |
LL |     #[label(code = "...")]
   |             ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:225:5
   |
LL |     #[label(code = "...")]
   |     ^

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/subdiagnostic-derive.rs:254:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): label without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:251:1
   |
LL | #[label(no_crate_example)]
   | ^

error: derive(Diagnostic): `#[applicability]` is only valid on suggestions
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:264:5
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): `#[bar]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:274:5
   |
LL |     #[bar]
   |     ^
   |
   = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes

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

error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:296:5
   |
LL |     #[bar("...")]
   |     ^
   |
   = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:328:44
   |
LL | #[label(no_crate_example, no_crate::example)]
   |                                            ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:341:5
   |
LL |     #[primary_span]
   |     ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:338:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): subdiagnostic kind not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:347:8
   |
LL | struct AG {
   |        ^^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:384:46
   |
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
   |                                              ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:384:32
   |
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
   |                                ^^^^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:402:5
   |
---
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): the `#[applicability]` attribute can only be applied to fields of type `Applicability`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:412:5
   |
LL |     #[applicability]
   |     ^

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

error: derive(Diagnostic): invalid applicability
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:435:62
   |
LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
   |                                                              ^^^^^

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:453:1
   |
LL | #[suggestion(no_crate_example, code = "...")]
   | ^

error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:467:1
   |
LL | #[label]
   | ^

error: derive(Diagnostic): `var` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:487:39
   |
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
   |                                       ^^^^^^^

error: derive(Diagnostic): `var` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:506:43
   |
LL |     #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
   |                                           ^^^^^^^

error: derive(Diagnostic): `#[suggestion_part]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:529:5
   |
LL |     #[suggestion_part]
   |     ^
   |
   = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead

error: derive(Diagnostic): `#[suggestion_part(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:532:5
   |
LL |     #[suggestion_part(code = "...")]
   |     ^
   |
   = help: `#[suggestion_part(...)]` is only valid in multipart suggestions

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:526:1
   |
LL | #[suggestion(no_crate_example, code = "...")]
   | ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:541:42
   |
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
   |                                          ^^^^
   |
   = help: only `no_span`, `style` and `applicability` are valid nested attributes

error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:541:1
   |
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
   | ^

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

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

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:568:5
   |
LL |     #[primary_span]
   |     ^
   |
   = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`

error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:565:1
   |
LL | #[multipart_suggestion(no_crate_example)]
   | ^

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

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

error: derive(Diagnostic): `code` is the only valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:582:23
   |
LL |     #[suggestion_part(foo = "bar")]
   |                       ^^^

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

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

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:598:37
   |
LL |     #[suggestion_part(code = "...", code = ",,,")]
   |                                     ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:598:23
   |
LL |     #[suggestion_part(code = "...", code = ",,,")]
   |                       ^^^^

error: derive(Diagnostic): `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:627:5
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:675:34
   |
LL |     #[suggestion_part(code("foo"))]
   |                                  ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:686:41
   |
LL |     #[suggestion_part(code("foo", "bar"))]
   |                                         ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:697:30
   |
LL |     #[suggestion_part(code(3))]
   |                              ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:708:29
   |
LL |     #[suggestion_part(code())]
   |                             ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:763:1
   |
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
   | ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:763:1
   |
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
   | ^

error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:772:1
   |
LL | #[suggestion_hidden(no_crate_example, code = "")]
   | ^
   |
   = help: Use `#[suggestion(..., style = "hidden")]` instead

error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:780:1
   |
LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
   | ^
   |
   = help: Use `#[suggestion(..., style = "hidden")]` instead

error: derive(Diagnostic): invalid suggestion style
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:788:51
   |
LL | #[suggestion(no_crate_example, code = "", style = "foo")]
   |                                                   ^^^^^
   |
   = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`

error: derive(Diagnostic): expected `= "xxx"`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:796:49
   |
LL | #[suggestion(no_crate_example, code = "", style = 42)]
   |                                                 ^

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:804:48
   |
LL | #[suggestion(no_crate_example, code = "", style)]
   |                                                ^

error: derive(Diagnostic): expected `= "xxx"`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:812:48
   |
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
   |                                                ^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:825:5
   |
LL |     #[primary_span]
   |     ^
   |
   = note: there must be exactly one primary span
   = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:822:1
   |
LL | #[suggestion(no_crate_example, code = "")]
   | ^

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:96:9
   |
LL | #[label("...")]
   |         ^^^^^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:312:1
   |
LL | union AC {
   | ^^^^^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:582:27
   |
LL |     #[suggestion_part(foo = "bar")]
   |                           ^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:675:28
   |
LL |     #[suggestion_part(code("foo"))]
   |                            ^^^^^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:686:28
   |
LL |     #[suggestion_part(code("foo", "bar"))]
   |                            ^^^^^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:697:28
   |
LL |     #[suggestion_part(code(3))]
   |                            ^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:720:30
   |
LL |     #[suggestion_part(code = 3)]
   |                              ^ you might be missing crate `core`

error[E0433]: cannot find item `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:812:48
   |
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
   |                                                ^ you might be missing crate `core`

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

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:213:7
   |
LL |     #[bar("...")]
   |       ^^^

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:274:7
   |
---

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:296:7
   |
LL |     #[bar("...")]
   |       ^^^

error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:126:9
   |
LL | #[label(slug)]
   |         ^^^^ not found in `crate::fluent_generated`

error[E0425]: cannot find value `__code_29` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:714:10
   |
LL | #[derive(Subdiagnostic)]
   |          ^^^^^^^^^^^^^ not found in this scope
   |

@@ -1,4 +1,4 @@
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod`
error[E0433]: cannot find item `mod` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find item `mod` in this scope
error[E0433]: cannot find item `mod` in the crate root

r#mod in crate::r#mod is not resolved in the current scope.

@@ -1,4 +1,4 @@
error[E0433]: failed to resolve: partially resolved path in a macro
error[E0433]: cannot find macro `bar` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find macro `bar` in this scope
error[E0433]: cannot find macro `bar` in enum `Foo`

@@ -1,14 +1,14 @@
error[E0433]: failed to resolve: partially resolved path in a derive macro
error[E0433]: cannot find macro `Anything` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find macro `Anything` in this scope
error[E0433]: cannot find macro `Anything` in trait `Foo`

| ^^^^^ there are too many leading `super` keywords
| ^^^^^ can't use `super` as an identifier
|
help: if you still want to call your identifier `super`, use the raw identifier format
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path segment keywords (is_path_segment_keyword) like self or super cannot be raw identifiers.

@@ -1,4 +1,4 @@
error[E0433]: failed to resolve: partially resolved path in a macro
error[E0433]: cannot find macro `Ok` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find macro `Ok` in this scope
error[E0433]: cannot find macro `Ok` in enum `Result`

@@ -58,7 +58,7 @@ extern crate macro_helpers as _;
/* lang and libs implicitly in scope */

// tool/extern -> extern
#[type_ns::inner] //~ ERROR could not find `inner` in `type_ns`
#[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `macro_helpers`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `macro_helpers`
#[type_ns::inner] //~ ERROR cannot find macro `inner` in crate `type_ns`

would be preferable, although I'm not sure.

@@ -16,7 +16,7 @@ error[E0742]: visibilities can only be restricted to ancestor modules
LL | pub(in std::vec) struct F;
| ^^^^^^^^

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
error[E0433]: cannot find item `nonexistent` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find item `nonexistent` in this scope
error[E0433]: cannot find item `nonexistent` in the crate root

This is 2015 edition, so imports and visibilities are resolved in the root module.

@@ -1,4 +1,4 @@
error[E0433]: failed to resolve: `String` is a struct, not a module
error[E0433]: cannot find module `String` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error[E0433]: cannot find module `String` in this scope
error[E0433]: cannot find module `String` in module `string`

@@ -41,7 +41,7 @@ LL - bar: st::cell::Cell<bool>
LL + bar: cell::Cell<bool>
|

error[E0433]: failed to resolve: function `bar` is not a crate or module
error[E0433]: cannot find item `bar` in this scope
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can find bar, but it's a function and not a module, the previous error told about that.

format!(
"partially resolved path in {} {}",
kind.article(),
kind.descr()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could give a more precise description, like "attribute macro" or "derive macro".

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants