mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 13:40:15 +03:00
Undo accidental test deletion in previous commit.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
static X: usize = 5;
|
||||
|
||||
#[allow(mutable_transmutes)]
|
||||
fn main() {
|
||||
unsafe {
|
||||
*std::mem::transmute::<&usize, &mut usize>(&X) = 6; //~ ERROR: tried to modify constant memory
|
||||
assert_eq!(X, 6);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user