Skip to content

Remove rustc-dev un-remapping#152916

Closed
bjorn3 wants to merge 1 commit intorust-lang:mainfrom
bjorn3:no_rustc_dev_unremap_debuginfo
Closed

Remove rustc-dev un-remapping#152916
bjorn3 wants to merge 1 commit intorust-lang:mainfrom
bjorn3:no_rustc_dev_unremap_debuginfo

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Feb 20, 2026

During local development it doesn't matter, for end users it doesn't help as it doesn't affect the precompiled rustc executable and during development of custom drivers, most paths are kept remapped anyway due to rustc not getting recompiled. As such for the use cases where you want the original source paths, you either already have the original source paths or un-remapping doesn't have any effect.

During local development it doesn't matter, for end users it doesn't
help as it doesn't affect the precompiled rustc executable and during
development of custom drivers, most paths are kept remapped anyway due
to rustc not getting recompiled. As such for the use cases where you
want the original source paths, you either already have the original
source paths or un-remapping doesn't have any effect.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 20, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 20, 2026

r? @chenyukang

rustbot has assigned @chenyukang.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 68 candidates
  • Random selection from 14 candidates

@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)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    afc745c7535d   3 weeks ago   783MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:faae3d3a1dedd24cde388bb506bbacc0f7ed1eae99ebac129af66acd8540c84a
deleted: sha256:afc745c7535da1bb12f92c273b9a7e9c52c3f12c5873714b2542da259c6d9769
deleted: sha256:64e147d5e54d9be8b8aa322e511cda02296eda4b8b8d063c6a314833aca50e29
deleted: sha256:5cba409bb463f4e7fa1a19f695450170422582c1bc7c0e934d893b4e5f558bc6
deleted: sha256:cddc6ebd344b0111eaab170ead1dfda24acdfe865ed8a12599a34d338fa8e28b
deleted: sha256:2412c3f334d79134573cd45e657fb6cc0abd75bef3881458b0d498d936545c8d
---
test [ui] tests/ui/abi/abi-sysv64-register-usage.rs ... ignored, ignored when the architecture is aarch64
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_enabled ... ok
test [ui] tests/ui/abi/abi-typo-unstable.rs#feature_disabled ... ok
test [ui] tests/ui/abi/anon-extern-mod.rs ... ok
test [ui] tests/ui/abi/avr-sram.rs#disable_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#aarch64 ... ok
test [ui] tests/ui/abi/avr-sram.rs#has_sram ... ok
test [ui] tests/ui/abi/avr-sram.rs#no_sram ... ok
test [ui] tests/ui/abi/arm-unadjusted-intrinsic.rs#arm ... ok
test [ui] tests/ui/abi/bad-custom.rs ... ok
test [ui] tests/ui/abi/c-stack-as-value.rs ... ok
test [ui] tests/ui/abi/c-zst.rs#aarch64-darwin ... ok
test [ui] tests/ui/abi/c-zst.rs#powerpc-linux ... ok
---
test [ui] tests/ui/asm/aarch64/type-check-2-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-2.rs ... ok
test [ui] tests/ui/asm/aarch64/type-check-3.rs ... ok
test [ui] tests/ui/asm/aarch64/type-f16.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#hf ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#r82 ... ok
test [ui] tests/ui/asm/arm-low-dreg.rs ... ok
test [ui] tests/ui/asm/aarch64v8r.rs#sf ... ok
test [ui] tests/ui/asm/asm-with-nested-closure.rs ... ok
test [ui] tests/ui/asm/binary_asm_labels.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/asm/aarch64/sym.rs ... ok
test [ui] tests/ui/asm/cfg-parse-error.rs ... ok
test [ui] tests/ui/asm/cfg.rs#reva ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/const-generics/occurs-check/unused-substs-3.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-5.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic.rs ... ok
test [ui] tests/ui/const-generics/occurs-check/unused-substs-4.rs ... ok
test [ui] tests/ui/const-generics/ogca/basic-fail.rs ... ok
test [ui] tests/ui/const-generics/ogca/rhs-but-not-root.rs ... ok
test [ui] tests/ui/const-generics/ogca/coherence-ambiguous.rs ... ok
test [ui] tests/ui/const-generics/opaque_types.rs ... ok
test [ui] tests/ui/const-generics/outer-lifetime-in-const-generic-default.rs ... ok
test [ui] tests/ui/const-generics/opaque_types2.rs ... ok
test [ui] tests/ui/const-generics/overlapping_impls.rs ... ok
test [ui] tests/ui/const-generics/params-in-ct-in-ty-param-lazy-norm.rs#full ... ok
---
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/no-mangle-associated-fn.rs ... ok
test [ui] tests/ui/extern/not-in-block.rs ... ok
test [ui] tests/ui/extern/unsized-extern-derefmove.rs ... ok
test [ui] tests/ui/extern/issue-64655-extern-rust-must-allow-unwind.rs#thin1 ... ok
test [ui] tests/ui/feature-gates/allow-features-empty.rs ... ok
---
test [ui] tests/ui/feature-gates/feature-gate-macro-metavar-expr-concat.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-marker_trait_attr.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-may-dangle.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-min-generic-const-args.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-mgca-type-const-syntax.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-movrs_target_feature.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/feature-gates/feature-gate-min_const_fn.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-more-maybe-bounds.rs ... ok
test [ui] tests/ui/feature-gates/feature-gate-naked_functions_rustic_abi.rs ... ignored, only executed when the architecture is x86_64
test [ui] tests/ui/feature-gates/feature-gate-naked_functions_target_feature.rs ... ignored, only executed when the architecture is x86_64
---
test [ui] tests/ui/imports/ambiguous-9.rs ... ok
test [ui] tests/ui/imports/ambiguous-import-visibility-module.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-glob-vs-multiouter.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-globvsglob.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
test [ui] tests/ui/imports/ambiguous-panic-pick-core.rs ... ok
test [ui] tests/ui/imports/ambiguous-panic-pick-std.rs ... ok
---
test [ui] tests/ui/layout/post-mono-layout-cycle.rs ... ok
test [ui] tests/ui/layout/randomize.rs#normal ... ok
test [ui] tests/ui/layout/randomize.rs#randomize-layout ... ok
test [ui] tests/ui/layout/null-pointer-optimization.rs ... ok
test [ui] tests/ui/layout/rigid-alias-due-to-broken-impl.rs ... ok
test [ui] tests/ui/layout/size-of-val-raw-too-big.rs ... ignored, only executed when the pointer width is 32bit (Layout computation rejects this layout for different reasons on 64-bit.)
test [ui] tests/ui/layout/reprc-power-alignment.rs ... ok
test [ui] tests/ui/layout/struct.rs ... ok
test [ui] tests/ui/layout/rust-call-abi-not-a-tuple-ice-81974.rs ... ok
test [ui] tests/ui/layout/rigid-alias-no-params.rs ... ok
---
diff of stderr:

10 LL | struct NotAValidResultType;
11    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
12 help: the following other types implement trait `VisitorResult`
-   --> /rustc-dev/xyz/compiler/rustc_ast_ir/src/visit.rs:LL:COL
+   --> compiler/rustc_ast_ir/src/visit.rs:LL:COL
14    |
15    = note: `()`
-   ::: /rustc-dev/xyz/compiler/rustc_ast_ir/src/visit.rs:LL:COL
+   ::: compiler/rustc_ast_ir/src/visit.rs:LL:COL
17    |
18    = note: `ControlFlow<T>`
19 note: required by a bound in `rustc_ast::visit::Visitor::Result`

-   --> /rustc-dev/xyz/compiler/rustc_ast/src/visit.rs:LL:COL
-   ::: /rustc-dev/xyz/compiler/rustc_ast/src/visit.rs:LL:COL
+   --> compiler/rustc_ast/src/visit.rs:LL:COL
+   ::: compiler/rustc_ast/src/visit.rs:LL:COL
22    |
23    = note: in this macro invocation
24    = note: this error originates in the macro `common_visitor_and_walkers` (in Nightly builds, run with -Z macro-backtrace for more info)
---
To only update this specific test, also pass `--test-args rustc-dev-remap.rs`

error in revision `only-remap`: 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/rustc-dev-remap.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" "--cfg" "only_remap" "--check-cfg" "cfg(test,FALSE,only_remap,remap_unremap)" "--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/rustc-dev-remap.only-remap" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Z" "simulate-remapped-rust-src-base=/rustc-dev/xyz"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `NotAValidResultType: VisitorResult` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/rustc-dev-remap.rs:26:19
   |
LL |     type Result = NotAValidResultType;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the nightly-only, unstable trait `VisitorResult` is not implemented for `NotAValidResultType`
  --> /checkout/tests/ui-fulldeps/rustc-dev-remap.rs:23:1
   |
LL | struct NotAValidResultType;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: the following other types implement trait `VisitorResult`
---
22    |
- LL |                 type Result: VisitorResult = ();
-    |                              ^^^^^^^^^^^^^ required by this bound in `Visitor::Result`
- ...
- LL | common_visitor_and_walkers!(Visitor<'a>);
-    | ---------------------------------------- in this macro invocation
+    = note: in this macro invocation
28    = note: this error originates in the macro `common_visitor_and_walkers` (in Nightly builds, run with -Z macro-backtrace for more info)
29 
30 error: aborting due to 1 previous error
---
To only update this specific test, also pass `--test-args rustc-dev-remap.rs`

error in revision `remap-unremap`: 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/rustc-dev-remap.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" "--cfg" "remap_unremap" "--check-cfg" "cfg(test,FALSE,only_remap,remap_unremap)" "--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/rustc-dev-remap.remap-unremap" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Z" "simulate-remapped-rust-src-base=/rustc-dev/xyz" "-Ztranslate-remapped-path-to-local-path=yes"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `NotAValidResultType: VisitorResult` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/rustc-dev-remap.rs:26:19
   |
LL |     type Result = NotAValidResultType;
   |                   ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
   |
help: the nightly-only, unstable trait `VisitorResult` is not implemented for `NotAValidResultType`
  --> /checkout/tests/ui-fulldeps/rustc-dev-remap.rs:23:1
   |
LL | struct NotAValidResultType;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: the following other types implement trait `VisitorResult`
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field/diagnostic-derive-doc-comment-field.stderr`
diff of stderr:

14    | ^^^^^^^^^^^^^^^^^^^^^
15    = help: normalized in stderr
16 note: required by a bound in `Diag::<'a, G>::arg`
-   --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
-   ::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   --> compiler/rustc_errors/src/diagnostic.rs:502:8
+   ::: compiler/rustc_errors/src/diagnostic.rs:1216:7
19    |
20    = note: in this macro invocation
21    = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

36    | ^^^^^^^^^^^^^^^^^^^^^
37    = help: normalized in stderr
38 note: required by a bound in `Diag::<'a, G>::arg`
-   --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
-   ::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   --> compiler/rustc_errors/src/diagnostic.rs:502:8
+   ::: compiler/rustc_errors/src/diagnostic.rs:1216:7
41    |
42    = note: in this macro invocation
43    = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
---
To only update this specific test, also pass `--test-args session-diagnostic/diagnostic-derive-doc-comment-field.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-doc-comment-field.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-doc-comment-field" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error[E0277]: the trait bound `NotIntoDiagArg: IntoDiagArg` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-doc-comment-field.rs:34:10
   |
---
             Box<(dyn std::error::Error + 'static)>
             CString
             Cow<'a, str>
           and 53 others
note: required by a bound in `Diag::<'a, G>::arg`
  --> compiler/rustc_errors/src/diagnostic.rs:502:8
  ::: compiler/rustc_errors/src/diagnostic.rs:1216: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)
---
             Box<(dyn std::error::Error + 'static)>
             CString
             Cow<'a, str>
           and 53 others
note: required by a bound in `Diag::<'a, G>::arg`
  --> compiler/rustc_errors/src/diagnostic.rs:502:8
  ::: compiler/rustc_errors/src/diagnostic.rs:1216: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)
---
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive-inline/diagnostic-derive-inline.stderr`
diff of stderr:

630    | ^^^^^^^^^^^^
631    = help: normalized in stderr
632 note: required by a bound in `Diag::<'a, G>::arg`
-   --> $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
-   ::: $COMPILER_DIR/rustc_errors/src/diagnostic.rs:LL:CC
+   --> compiler/rustc_errors/src/diagnostic.rs:502:8
+   ::: compiler/rustc_errors/src/diagnostic.rs:1216:7
635    |
636    = note: in this macro invocation
637    = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)
---
To only update this specific test, also pass `--test-args session-diagnostic/diagnostic-derive-inline.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-inline.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-inline" "-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-inline.rs:44:1
   |
LL | #[diag("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:47:5
   |
LL |     Foo,
   |     ^^^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:49:5
   |
LL |     Bar,
   |     ^^^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: expected parentheses: #[diag(...)]
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:55:8
   |
LL | #[diag = "E0123"]
   |        ^

error: derive(Diagnostic): `#[nonsense(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:60:1
   |
LL | #[nonsense("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:60:1
   |
LL | #[nonsense("this is an example message", code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:67:1
   |
LL | #[diag(code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:72:1
   |
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:77:1
   |
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:82:1
   |
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

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

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

---

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:106:52
   |
LL | #[diag("this is an example message", code = E0123, code = E0456)]
   |                                                    ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:106:38
   |
LL | #[diag("this is an example message", code = E0123, code = E0456)]
   |                                      ^^^^

error: derive(Diagnostic): diagnostic message must be the first argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:111:38
   |
LL | #[diag("this is an example message", no_crate::example, code = E0123)]
   |                                      ^^^^^^^^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:116:1
   |
LL | struct KindNotProvided {} //~ ERROR diagnostic message not specified
   | ^^^^^^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:119:1
   |
LL | #[diag(code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("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-inline.rs:130:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): `#[nonsense]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:138: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-inline.rs:155:5
   |
LL |     #[label("with a label")]
   |     ^

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

error: invalid format string: expected `}` but string was terminated
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:168: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-inline.rs:178: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-inline.rs:198:5
   |
LL |     #[label("with a label")]
   |     ^

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

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

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

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

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

error: derive(Diagnostic): wrong field type for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:257:5
   |
LL |     #[suggestion("with a 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-inline.rs:273: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-inline.rs:288:5
   |
LL |     #[label = "bar"]
   |     ^

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

error: derive(Diagnostic): invalid applicability
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:397:69
   |
LL |     #[suggestion("with a 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-inline.rs:460:5
   |
LL |     #[help("with a help")]
   |     ^

error: derive(Diagnostic): no nested attribute expected here
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:469:29
   |
LL |     #[label("with a label", foo)]
   |                             ^^^

error: derive(Diagnostic): a diagnostic message must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:477:29
   |
LL |     #[label("with a label", "and another one?")]
   |                             ^^^^^^^^^^^^^^^^^^

error: derive(Diagnostic): no nested attribute expected here
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:485:29
   |
LL |     #[label("with a label", foo = "...")]
   |                             ^^^

error: derive(Diagnostic): no nested attribute expected here
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:493:29
   |
LL |     #[label("with a label", foo("..."))]
   |                             ^^^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:505: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-inline.rs:525:1
   |
LL | #[error("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:525:1
   |
LL | #[error("this is an example message", code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:532:1
   |
LL | #[warn_("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:532:1
   |
LL | #[warn_("this is an example message", code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:539:1
   |
LL | #[lint("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:539:1
   |
LL | #[lint("this is an example message", code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:546:1
   |
LL | #[lint("this is an example message", code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic message not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:546:1
   |
LL | #[lint("this is an example message", code = E0123)]
   | ^
   |
   = help: specify the message as the first argument to the `#[diag(...)]` attribute, such as `#[diag("Example error")]`

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

error: derive(Diagnostic): wrong types for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:564: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-inline.rs:572: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-inline.rs:579:5
   |
LL |     #[suggestion("with a suggestion")]
   |     ^

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:586:1
   |
LL | #[multipart_suggestion("with a 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-inline.rs:589: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-inline.rs:593:5
   |
LL |     #[multipart_suggestion("with a 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-inline.rs:601:1
   |
LL | #[suggestion("with a 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-inline.rs:610:1
   |
LL | #[label]
   | ^
   |
   = help: subdiagnostic message is missing

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

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

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

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

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

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

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

error: derive(Diagnostic): expected at least one string literal for `code(...)`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:736:44
   |
LL |     #[suggestion("with a suggestion", code())]
   |                                            ^

error: derive(Diagnostic): `code(...)` must contain only string literals
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:744:44
   |
LL |     #[suggestion("with a suggestion", code(foo))]
   |                                            ^^^

error: unexpected token, expected `)`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:744:44
   |
LL |     #[suggestion("with a suggestion", code(foo))]
   |                                            ^^^

error: expected string literal
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:753:46
   |
LL |     #[suggestion("with a suggestion", code = 3)]
   |                                              ^

error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:768:5
   |
LL |     #[suggestion("with a 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: derive(Diagnostic): Variable `nosub` not found in diagnostic 
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:780:8
   |
LL | #[diag("does not exist: {$nosub}")]
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: Available fields: "sub"

error: cannot find attribute `nonsense` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:60:3
   |
LL | #[nonsense("this is an example message", code = E0123)]
   |   ^^^^^^^^

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

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

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

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

error: cannot find attribute `multipart_suggestion` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:586:3
   |
LL | #[multipart_suggestion("with a suggestion")]
   |   ^^^^^^^^^^^^^^^^^^^^
   |
help: `multipart_suggestion` is an attribute that can be used by the derive macro `Subdiagnostic`, you might be missing a `derive` attribute
   |
LL + #[derive(Subdiagnostic)]
---

error: cannot find attribute `multipart_suggestion` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:593:7
   |
LL |     #[multipart_suggestion("with a suggestion")]
   |       ^^^^^^^^^^^^^^^^^^^^
   |
   = note: `multipart_suggestion` is an attribute that can be used by the derive macro `Subdiagnostic`, you might be missing a `derive` attribute

error[E0277]: the trait bound `Hello: IntoDiagArg` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs:329: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`
  --> compiler/rustc_errors/src/diagnostic.rs:502:8
  ::: compiler/rustc_errors/src/diagnostic.rs:1216: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)

@Urgau
Copy link
Member

Urgau commented Feb 20, 2026

This un-remapping was added specifically for Clippy needs, and does have an effect, see #142377.

cc @samueltardieu
r? Urgau

@rustbot rustbot assigned Urgau and unassigned chenyukang Feb 20, 2026
@samueltardieu
Copy link
Member

samueltardieu commented Feb 20, 2026

The original discussion was in this Zulip topic.

@Urgau Urgau 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 Feb 20, 2026
@bjorn3
Copy link
Member Author

bjorn3 commented Feb 20, 2026

I don't understand what the issue there was. Why does it matter for clippy that source paths are mapped back to an on-disk file? The debuginfo will have many paths not un-remapped anyway and for diagnostics errors in clippy shouldn't generally result in rustc source being used.

@samueltardieu
Copy link
Member

For example, some Clippy lint messages point to the snippet where an entity was defined. Since Clippy itself uses types, functions, and macros from the compiler libraries, when linting Clippy it will show code snippets coming from the compiler sources.

Any program using the compiler libraries would suffer from the same problem when linted with Clippy, or more generally when attempting to retrieve the source snippet corresponding to some place in the compiler libraries, or even to point at the file on disk where this code comes from.

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 4, 2026

For example, some Clippy lint messages point to the snippet where an entity was defined. Since Clippy itself uses types, functions, and macros from the compiler libraries, when linting Clippy it will show code snippets coming from the compiler sources.

Is that actually important? The source of the error is in clippy, not in rustc.

@samueltardieu
Copy link
Member

samueltardieu commented Mar 4, 2026

Is that actually important? The source of the error is in clippy, not in rustc.

Well, for the quality of error messages, it is. And with no or improper remapping, we hit a situation where retrieving a snippet doesn't work, which never happens otherwise.

You didn't tell why it was important to you to remove this un-remapping? How does it hurt?

Note that the un-remapping hasn't been added for Clippy, it has been fixed for Clippy, as you can see in the original issue, it was incorrect before.

@bjorn3
Copy link
Member Author

bjorn3 commented Mar 4, 2026

Well, for the quality of error messages, it is. And with no or improper remapping, we hit a situation where retrieving a snippet doesn't work, which never happens otherwise.

Does it actually matter that retrieving the snippets doesn't work? It is already the case for most people that the standard library source is unavailable, so rustc has to (and should be) able to generate high quality diagnostics when the sources for a dependency are missing.

Note that the un-remapping hasn't been added for Clippy, it has been fixed for Clippy, as you can see in the original issue, it was incorrect before.

Un-remapping was incorrectly applied but #141751 fixed that to not try to un-remap at all. #142377 then made it remap to the correct location. This PR only reverts #142377.

You didn't tell why it was important to you to remove this un-remapping? How does it hurt?

It doesn't hurt a lot. I'm just not that happy with the un-remapping. It doesn't just affect diagnostics, but also causes un-remapped paths to end up in the debuginfo depending on if the source files are available or not, which both hurts reproducibility and AFAIK isn't tracked by cargo (so cargo incorrectly doesn't rebuild when you install rust-src, causing a mix between crates where un-remapping is applied and ones where it isn't). I figured I could remove it for rustc sources to make it a tiny bit less of an issue. But if you feel strongly against it, I don't mind closing this PR.

@samueltardieu
Copy link
Member

If you don't mind, I would prefer indeed to postpone this PR: I would like to evaluate the consequences of not getting some snippets. This is handled of course, in the sense it won't crash, but I suspect that we have many places where the way to handle this is akin get_snippet(cx, span)? and aborts the current lint without signaling (while it should only affect the diagnostic, not the fact that the lint triggers).

I'll add this to my TODO list.

@bjorn3 bjorn3 closed this Mar 4, 2026
@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 Mar 4, 2026
@bjorn3 bjorn3 deleted the no_rustc_dev_unremap_debuginfo branch March 4, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

6 participants