Comments (3)
rustc
has two name mangling schemes, legacy
(the default for now) and v0
(which will become the default at some point in the future).
legacy
disambiguates duplicate symbol names (such as the call_once
methods of different closures) by including a unique-per-symbol hash in each name. CE’s demangler could include this hash, but doesn’t currently. FWIW, c++filt
includes the hash by default.
v0
was designed so that a demangled name should be unique by itself. (Note: It still uses a hash to disambiguate crates with the same name.)
Always including the hash might make sense for legacy
mangling, but for v0
it’s mostly unnecessary information (duplicate crates in different versions are rare on CE, also the v0
RFC recommends omitting the crate-id), so I’d suggest a new checkbox Options... → Include disambiguating hashes in identifiers (wording TBD) that controls whether hashes are included. Another wording could be Verbose demangling, which is what c++filt
calls this.
v0
demanglings for a closure’s call_once
method without and with crate-ids:
<example::get_multiplier::{closure#0} as core::ops::function::FnOnce<(u32, u32)>>::call_once:
<example[e8d519bf5b4bcf09]::get_multiplier::{closure#0} as core[5a612027cd243909]::ops::function::FnOnce<(u32, u32)>>::call_once:
As a workaround, -C symbol-mangling-version=v0
can be passed to the compiler: https://godbolt.org/z/zxEf7P6rj
from compiler-explorer.
Using v0 if available seems to make a lot more sense to me.
It's not easy to add something like a counter as it will require a lot more logic, or we would have to make them unique by adding the hash to the demangled name.
(for reference, demangler is here https://github.com/compiler-explorer/tools/blob/main/rust/src/main.rs (we might need to rebuild this anyway) - but the names are passed 1 by 1 by this TS code https://github.com/compiler-explorer/compiler-explorer/tree/main/lib/demangler)
(we use this for c++ (demanglerType=cpp) -> https://github.com/compiler-explorer/compiler-explorer/blob/main/lib/demangler/cpp.ts to add extra text to the demangled names)
from compiler-explorer.
I implemented the checkbox I proposed in #6265.
Also, this issue has come up before: #1754.
from compiler-explorer.
Related Issues (20)
- ppc64 and ppc64le nightly cross gcc failures HOT 1
- [REQUEST]: Permit "Add Executor" to Conformance View
- [BUG]: Xtensa ESP32 LEND loop targets are filtered as directives HOT 4
- [COMPILER REQUEST]: GraalVM Native Image
- [BUG]: code compiles to either infinite loop or nothing with -O3 HOT 3
- [COMPILER REQUEST]: QuickJS
- TypeError: opcodes is not iterable
- Can't link with gcc 4.7.1 and 4.7.2 HOT 1
- [BUG]: recompiling resets scroll position to the top
- [LIB REQUEST] pycryptodome & cryptography
- [COMPILER REQUEST]: sh-elf-gdc HOT 4
- [BUG]: Mobile mode can't be edited? HOT 1
- [BUG]: Browser tab refresh resets all renamed CE tabs
- [COMPILER REQUEST]: Groovy HOT 1
- [BUG]: char8_t not declared even with -std=c23 HOT 1
- Make lines linkable HOT 3
- [BUG]: preprocessor output is empty when using MS compiler
- [BUG]: permission denied opening /dev/null HOT 5
- [BUG]: Mfem library not loading: single vs double precision not specified
- [BUG]: Internal Compiler Explorer error: Error: Unexpected basic block terminator: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compiler-explorer.