add implementation-internal namespace for globalasm #149268
Open
+20
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #138261
Adds a namespace for
global_asmwith a lowercase letter which is reserved for implementation-internal disambiguation:As a implementation-internal disambiguation category, the demangler implementations shouldn't need updated (i.e. if this were an uppercase letter, then our mangle-then-demangle checks would fail because the demangler would expect to have explicit handling).
'a'is chosen arbitrarily, for asm, but I can change it to something else if preferred.#[rustc_symbol_name]only looks at top-level items, and would need a bunch of changes to be able to check the symbol forfoo::{constant}::{closure}in theglobal_asmin this test, so for now the test just checks this compiles.The alternative to this would be to prohibit declaration of items in the operand of a
global_asm, which is a breaking change.