Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#![feature(linkage)] | ||
#![crate_type = "lib"] | ||
|
||
#[linkage="external"] | ||
pub static EXTERN: u32 = 0; |
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,10 @@ | ||
// rust-lang/rust#59548: We used to ICE when trying to use a static | ||
// with a type that violated its own `#[linkage]`. | ||
|
||
// aux-build:def_illtyped_external.rs | ||
|
||
extern crate def_illtyped_external as dep; | ||
|
||
fn main() { | ||
println!("{:p}", &dep::EXTERN); | ||
} |
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,8 @@ | ||
error: must have type `*const T` or `*mut T` due to `#[linkage]` attribute | ||
--> $DIR/auxiliary/def_illtyped_external.rs:5:1 | ||
| | ||
LL | pub static EXTERN: u32 = 0; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|