-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #2241 - RalfJung:extern_static_in_const, r=RalfJung
fix ICE when const refers to extern static Fixes #2234 Needs rust-lang/rust#98099
- Loading branch information
Showing
5 changed files
with
44 additions
and
6 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 |
---|---|---|
@@ -1 +1 @@ | ||
cdcc53b7dc002ea4a7a28105010c5a1126ee31b7 | ||
a09c668c965f735f4cd59e7158662b9daa0b71ba |
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
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
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,11 @@ | ||
//! Even referencing an unknown `extern static` already triggers an error. | ||
|
||
extern "C" { | ||
static E: [u8; 0]; | ||
} | ||
|
||
static X: &'static [u8; 0] = unsafe { &E }; | ||
|
||
fn main() { | ||
let _val = X; //~ ERROR is not supported by Miri | ||
} |
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,14 @@ | ||
error: unsupported operation: `extern` static `E` from crate `extern_static_in_const` is not supported by Miri | ||
--> $DIR/extern_static_in_const.rs:LL:CC | ||
| | ||
LL | let _val = X; | ||
| ^ `extern` static `E` from crate `extern_static_in_const` is not supported by Miri | ||
| | ||
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support | ||
|
||
= note: inside `main` at $DIR/extern_static_in_const.rs:LL:CC | ||
|
||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | ||
|
||
error: aborting due to previous error | ||
|