forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#92316 - petrochenkov:extmangle, r=wesleywiser
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.)
- Loading branch information
Showing
4 changed files
with
58 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// build-fail | ||
// compile-flags: -C symbol-mangling-version=v0 | ||
|
||
#![feature(extern_types)] | ||
#![feature(rustc_attrs)] | ||
|
||
extern "C" { | ||
type ForeignType; | ||
} | ||
|
||
struct Check<T: ?Sized>(T); | ||
|
||
#[rustc_symbol_name] | ||
//~^ ERROR symbol-name(_RMCs | ||
//~| ERROR demangling(<foreign_types[ | ||
//~| ERROR demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>) | ||
impl Check<ForeignType> {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: symbol-name(_RMCsCRATE_HASH_13foreign_typesINtB<REF>_5CheckNvB<REF>_11ForeignTypeE) | ||
--> $DIR/foreign-types.rs:13:1 | ||
| | ||
LL | #[rustc_symbol_name] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: demangling(<foreign_types[HASH]::Check<foreign_types[HASH]::ForeignType>>) | ||
--> $DIR/foreign-types.rs:13:1 | ||
| | ||
LL | #[rustc_symbol_name] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: demangling-alt(<foreign_types::Check<foreign_types::ForeignType>>) | ||
--> $DIR/foreign-types.rs:13:1 | ||
| | ||
LL | #[rustc_symbol_name] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters