Skip to content
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

Recommend to never display zero disambiguators when demangling v0 symbols #124514

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

Conversation

michaelwoerister
Copy link
Member

This PR extends the v0 symbol mangling documentation with the strong recommendation that demanglers should never display zero-disambiguators, especially when dealing with crate-root.

Being able to rely on C3foo to be rendered as foo (i.e. without explicit disambiguator value) rather than as foo[0] allows the compiler to encode things like new basic types in a backward compatible way. This idea has been originally proposed by @eddyb in the discussion around supporting f16 and f128 in the v0 mangling scheme. It is a generally useful mechanism for supporting a certain class of new elements in the v0 mangling scheme in a backward compatible way (whether as a temporary workaround until downstream tooling has picked up grammar changes or as a permanent encoding).

cc @tgross35

@rustbot
Copy link
Collaborator

rustbot commented Apr 29, 2024

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 29, 2024
@michaelwoerister
Copy link
Member Author

cc @ehuss, as the original author of these (incredible) docs.

@GuillaumeGomez
Copy link
Member

r? eddyb

@michaelwoerister
Copy link
Member Author

@eddyb, would you like me to make any changes to this PR before it can be approved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants