]> git.lizzy.rs Git - rust.git/blob - src/test/ui/linkage-attr/linkage-detect-extern-generated-name-collision.rs
Rollup merge of #100861 - RalfJung:const-ice, r=oli-obk
[rust.git] / src / test / ui / linkage-attr / linkage-detect-extern-generated-name-collision.rs
1 // rust-lang/rust#61232: We used to ICE when trying to detect a
2 // collision on the symbol generated for the external linkage item in
3 // an extern crate.
4
5 // build-fail
6 // aux-build:def_colliding_external.rs
7 // FIXME(#83838) codegen-units=1 triggers llvm asserts
8 // compile-flags: -Ccodegen-units=16
9
10 extern crate def_colliding_external as dep1;
11
12 #[no_mangle]
13 pub static _rust_extern_with_linkage_collision: i32 = 0;
14
15 mod dep2 {
16     #[no_mangle]
17     pub static collision: usize = 0;
18 }
19
20 fn main() {
21     unsafe {
22        println!("{:p}", &dep1::collision);
23     }
24 }