rust/tests/ui/lint/clashing-extern-fn-wasm.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

22 lines
457 B
Rust
Raw Normal View History

2020-12-12 03:26:43 +00:00
// 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.
}
}
}