-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
mangling_v0: Skip extern blocks during mangling #92316
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
7a1ee6c
to
6bbbaf9
Compare
Hm, let's r? @wesleywiser perhaps? I'm not sure what our stability implications for v0 mangling are, though in general this seems fine to me. |
The mangling format itself doesn't seem to change, we should only drop some empty segments from it. |
Yeah, this seems fine. I can't think of any reason we would want or need to have an empty segment for the extern block in the mangled name (or that there would be stability implications from this change). @bors r+ |
📌 Commit 6bbbaf9 has been approved by |
mangling_v0: Skip extern blocks during mangling There's no need to include the dummy `Nt` into the symbol name, items in extern blocks belong to their parent modules for all purposes except for inheriting the ABI and attributes. Follow up to rust-lang#92032 (There's also a drive-by fix to the `rust-demangler` tool's tests, which don't run on CI, I initially attempted using them for testing this PR.)
6bbbaf9
to
333a5cc
Compare
@bors r=wesleywiser |
📌 Commit 333a5cc has been approved by |
mangling_v0: Skip extern blocks during mangling There's no need to include the dummy `Nt` into the symbol name, items in extern blocks belong to their parent modules for all purposes except for inheriting the ABI and attributes. Follow up to rust-lang#92032 (There's also a drive-by fix to the `rust-demangler` tool's tests, which don't run on CI, I initially attempted using them for testing this PR.)
mangling_v0: Skip extern blocks during mangling There's no need to include the dummy `Nt` into the symbol name, items in extern blocks belong to their parent modules for all purposes except for inheriting the ABI and attributes. Follow up to rust-lang#92032 (There's also a drive-by fix to the `rust-demangler` tool's tests, which don't run on CI, I initially attempted using them for testing this PR.)
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#92316 (mangling_v0: Skip extern blocks during mangling) - rust-lang#92630 (Change PhantomData type for `BuildHasherDefault` (and more)) - rust-lang#92800 (Add manifest docs fallback.) - rust-lang#93005 (Move back templates into html folder) - rust-lang#93065 (Pretty printer algorithm revamp step 2) - rust-lang#93077 (remove `List::is_noop`) Failed merges: - rust-lang#93068 (Fix spacing for `·` between stability and source) r? `@ghost` `@rustbot` modify labels: rollup
@petrochenkov Isn't this a collision hazard? If hygiene 2.0 can cause the same name to appear twice in a module, those two instances will have distinct But if one of them is So either the |
@eddyb Previously |
Oh yeah, I agree, rust/compiler/rustc_symbol_mangling/src/v0.rs Lines 782 to 787 in a7d6408
That is, the only other namespaces I could find are both uppercase ( In any case, namespaces (whether lowercase or uppercase) do not share encoding space with any other syntax, so most letters aren't used yet - this is intentional, to avoid running into issues if rustc decides to need a lot more namespaces for whatever reason (and if we somehow run out of all 52 of them, we can always shove extra information into the low bits of disambiguators, as unelegant as that is). |
There's no need to include the dummy
Nt
into the symbol name, items in extern blocks belong to their parent modules for all purposes except for inheriting the ABI and attributes.Follow up to #92032
(There's also a drive-by fix to the
rust-demangler
tool's tests, which don't run on CI, I initially attempted using them for testing this PR.)