-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #80009 - jumbatm:issue79581-overeager-clashing-extern-d…
…ecl, r=alexcrichton Use tcx.symbol_name when determining clashing extern declarations. Fixes #79581. r? `@alexcrichton`
- Loading branch information
Showing
2 changed files
with
35 additions
and
7 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,21 @@ | ||
// check-pass | ||
#![crate_type = "lib"] | ||
|
||
#[cfg(target_arch = "wasm32")] | ||
mod wasm_non_clash { | ||
mod a { | ||
#[link(wasm_import_module = "a")] | ||
extern "C" { | ||
pub fn foo(); | ||
} | ||
} | ||
|
||
mod b { | ||
#[link(wasm_import_module = "b")] | ||
extern "C" { | ||
pub fn foo() -> usize; | ||
// #79581: These declarations shouldn't clash because foreign fn names are mangled | ||
// on wasm32. | ||
} | ||
} | ||
} |