Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@michaelwoerister
Copy link
Member

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

Being able to rely onC3foo to be rendered asfoo (i.e. without explicit disambiguator value) rather than asfoo[0] allows the compiler to encode things like new basic types in a backward compatible way. This idea has been originally proposed by@eddyb inthe discussion around supportingf16 andf128 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

ehuss reacted with thumbs up emojitgross35 and eddyb reacted with heart emoji
@rustbot
Copy link
Collaborator

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.

User? to explicitly pick a reviewer

@rustbotrustbot added the S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelApr 29, 2024
@michaelwoerister
Copy link
MemberAuthor

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

@GuillaumeGomez
Copy link
Member

r? eddyb

@michaelwoerister
Copy link
MemberAuthor

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

@michaelwoerister
Copy link
MemberAuthor

@_eddyb seems to be unavailable at the moment.

r?@davidtwco maybe?

@rustbotrustbot assigneddavidtwco and unassignededdybJun 3, 2024
@davidtwco
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

📌 Commitc8a3697 has been approved bydavidtwco

It is now in thequeue for this repository.

@borsbors added S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelsJun 12, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull requestJun 12, 2024
…kingjubileeRollup of 16 pull requestsSuccessful merges: -rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) -rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols) -rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) -rust-lang#125980 (Nvptx remove direct passmode) -rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) -rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing) -rust-lang#126249 (Simplify `[T; N]::try_map` signature) -rust-lang#126256 (Add {{target}} substitution to compiletest) -rust-lang#126263 (Make issue-122805.rs big endian compatible) -rust-lang#126281 (set_env: State the conclusion upfront) -rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.) -rust-lang#126287 (Update a cranelift patch file for formatting changes.) -rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.) -rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) -rust-lang#126310 (Migrate run make prefer rlib) -rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits)r? `@ghost``@rustbot` modify labels: rollup
@borsbors merged commit969056d intorust-lang:masterJun 12, 2024
@rustbotrustbot added this to the1.81.0 milestoneJun 12, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull requestJun 12, 2024
Rollup merge ofrust-lang#124514 - michaelwoerister:zero-disambiguator-demangling-recommendation, r=davidtwcoRecommend to never display zero disambiguators when demangling v0 symbolsThis PR extends the [v0 symbol mangling documentation](https://doc.rust-lang.org/rustc/symbol-mangling/v0.html) 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](rust-lang#122106). 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`
bjorn3 pushed a commit to bjorn3/rust that referenced this pull requestJun 30, 2024
…kingjubileeRollup of 16 pull requestsSuccessful merges: -rust-lang#123374 (DOC: Add FFI example for slice::from_raw_parts()) -rust-lang#124514 (Recommend to never display zero disambiguators when demangling v0 symbols) -rust-lang#125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) -rust-lang#125980 (Nvptx remove direct passmode) -rust-lang#126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) -rust-lang#126210 (docs(core): make more const_ptr doctests assert instead of printing) -rust-lang#126249 (Simplify `[T; N]::try_map` signature) -rust-lang#126256 (Add {{target}} substitution to compiletest) -rust-lang#126263 (Make issue-122805.rs big endian compatible) -rust-lang#126281 (set_env: State the conclusion upfront) -rust-lang#126286 (Make `storage-live.rs` robust against rustc internal changes.) -rust-lang#126287 (Update a cranelift patch file for formatting changes.) -rust-lang#126301 (Use `tidy` to sort crate attributes for all compiler crates.) -rust-lang#126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) -rust-lang#126310 (Migrate run make prefer rlib) -rust-lang#126314 (fix RELEASES: we do not support upcasting to auto traits)r? `@ghost``@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@davidtwcodavidtwcodavidtwco approved these changes

Assignees

@davidtwcodavidtwco

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Milestone

1.81.0

Development

Successfully merging this pull request may close these issues.

6 participants

@michaelwoerister@rustbot@GuillaumeGomez@davidtwco@bors@eddyb

[8]ページ先頭

©2009-2025 Movatter.jp