Skip to content

Commit 4e60f53

Browse files
committed
Regression test for issue rust-lang#59548.
1 parent 444f2ba commit 4e60f53

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![feature(linkage)]
2+
#![crate_type = "lib"]
3+
4+
#[linkage="external"]
5+
pub static EXTERN: u32 = 0;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// rust-lang/rust#59548: We used to ICE when trying to use a static
2+
// with a type that violated its own `#[linkage]`.
3+
4+
// aux-build:def_illtyped_external.rs
5+
6+
extern crate def_illtyped_external as dep;
7+
8+
fn main() {
9+
println!("{:p}", &dep::EXTERN);
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute
2+
--> $DIR/auxiliary/def_illtyped_external.rs:5:1
3+
|
4+
LL | pub static EXTERN: u32 = 0;
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)