Skip to content

rustc_dump_symbol_name: add demangling information as a note instead - #163234

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:rustc_dump_symbol_name
Sep 24, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
mejrs:rustc_dump_symbol_name

Conversation

@mejrs

@mejrs mejrs commented Sep 23, 2026

Copy link
Copy Markdown
Member

Also edits the span a little, so that both the attribute and the item are shown.

Example:

#[rustc_dump_symbol_name]
fn mangled() {}

Previous output:

error: symbol-name(_RNvCsCRATE_HASH_22rustc_dump_symbol_name7mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: demangling(rustc_dump_symbol_name[6981ee133444a33d]::mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(rustc_dump_symbol_name::mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^

Output with this pr:

error: symbol-name(_RNvCsCRATE_HASH_10crate_name7mangled)
--> $DIR/rustc_dump_symbol_name.rs:8:1
 |
8 | / #[rustc_dump_symbol_name]
9 | | fn mangled() {}
 | |____________^
 |
 = note: demangling(crate_name[8cfd4c3bf0e8f389]::mangled)
 = note: demangling-alt(crate_name::mangled)

r? @fmease

@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. labels Sep 23, 2026

@fmease fmease left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's a lot more legible! Thanks :) @bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 983c56d has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #162976 (fix quadratic naming of duplicate sidebar links)
 - #161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test)
 - #163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features)
 - #163188 (Adjust for Arm64EC name mangling when checking for exported symbols)
 - #163211 (`rustc_builtin_macros` cleanup, part 6)
 - #161386 (Don't merge distinct impl candidates)
 - #162942 (Remove `StashKey::AssociatedTypeSuggestion`)
 - #163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates)
 - #163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable)
 - #163185 (properly decrement available_depth on cycles and provisional cache hits)
 - #163214 (revert r14 register names for arm)
 - #163226 (miri subtree update)
 - #163228 (Add regression test for trait predicate with escaping bounds)
 - #163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
@rust-bors
rust-bors Bot merged commit 6c262ac into rust-lang:main Sep 24, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
Rollup merge of #163234 - mejrs:rustc_dump_symbol_name, r=fmease

`rustc_dump_symbol_name`: add demangling information as a note instead

Also edits the span a little, so that both the attribute and the item are shown.

Example:
```
#[rustc_dump_symbol_name]
fn mangled() {}
```

Previous output:
```
error: symbol-name(_RNvCsCRATE_HASH_22rustc_dump_symbol_name7mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: demangling(rustc_dump_symbol_name[6981ee133444a33d]::mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: demangling-alt(rustc_dump_symbol_name::mangled)
--> $DIR/rustc_dump_symbol_name.rs:7:1
 |
7 | #[rustc_dump_symbol_name]
 | ^^^^^^^^^^^^^^^^^^^^^^^^^
```
Output with this pr:
```
error: symbol-name(_RNvCsCRATE_HASH_10crate_name7mangled)
--> $DIR/rustc_dump_symbol_name.rs:8:1
 |
8 | / #[rustc_dump_symbol_name]
9 | | fn mangled() {}
 | |____________^
 |
 = note: demangling(crate_name[8cfd4c3bf0e8f389]::mangled)
 = note: demangling-alt(crate_name::mangled)
```

r? @fmease
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 25, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#162976 (fix quadratic naming of duplicate sidebar links)
 - rust-lang/rust#161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test)
 - rust-lang/rust#163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features)
 - rust-lang/rust#163188 (Adjust for Arm64EC name mangling when checking for exported symbols)
 - rust-lang/rust#163211 (`rustc_builtin_macros` cleanup, part 6)
 - rust-lang/rust#161386 (Don't merge distinct impl candidates)
 - rust-lang/rust#162942 (Remove `StashKey::AssociatedTypeSuggestion`)
 - rust-lang/rust#163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates)
 - rust-lang/rust#163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable)
 - rust-lang/rust#163185 (properly decrement available_depth on cycles and provisional cache hits)
 - rust-lang/rust#163214 (revert r14 register names for arm)
 - rust-lang/rust#163226 (miri subtree update)
 - rust-lang/rust#163228 (Add regression test for trait predicate with escaping bounds)
 - rust-lang/rust#163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
github-actions Bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 2, 2026
…nathanBrouwer

Rollup of 14 pull requests

Successful merges:

 - rust-lang#162976 (fix quadratic naming of duplicate sidebar links)
 - rust-lang#161275 (Refactor `core::cmp::{smallest, largest}` & add `mir-opt` test)
 - rust-lang#163143 (cg_llvm: Use fewer FFI calls to check the target CPU's features)
 - rust-lang#163188 (Adjust for Arm64EC name mangling when checking for exported symbols)
 - rust-lang#163211 (`rustc_builtin_macros` cleanup, part 6)
 - rust-lang#161386 (Don't merge distinct impl candidates)
 - rust-lang#162942 (Remove `StashKey::AssociatedTypeSuggestion`)
 - rust-lang#163096 (Don't suggest `std::` rustfix paths in `#![no_std]` crates)
 - rust-lang#163110 (Mark `std::os::wasip2` with correct doc-cfgs, mark as unstable)
 - rust-lang#163185 (properly decrement available_depth on cycles and provisional cache hits)
 - rust-lang#163214 (revert r14 register names for arm)
 - rust-lang#163226 (miri subtree update)
 - rust-lang#163228 (Add regression test for trait predicate with escaping bounds)
 - rust-lang#163234 (`rustc_dump_symbol_name`: add demangling information as a note instead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants