]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/clashing-extern-fn-wasm.rs
Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
[rust.git] / tests / ui / lint / clashing-extern-fn-wasm.rs
1 // check-pass
2 #![crate_type = "lib"]
3
4 #[cfg(target_arch = "wasm32")]
5 mod wasm_non_clash {
6     mod a {
7         #[link(wasm_import_module = "a")]
8         extern "C" {
9             pub fn foo();
10         }
11     }
12
13     mod b {
14         #[link(wasm_import_module = "b")]
15         extern "C" {
16             pub fn foo() -> usize;
17             // #79581: These declarations shouldn't clash because foreign fn names are mangled
18             // on wasm32.
19         }
20     }
21 }