Skip to content

Commit ae5427f

Browse files
committed
Add a testcase for #13973
1 parent 2f56839 commit ae5427f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/compile-fail/check-static-values-constraints.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ static STATIC19: Box<isize> =
137137
box 3;
138138
//~^ ERROR allocations are not allowed in statics
139139

140+
static BLOCK_UNSAFE_SAFE_PTR: &'static int = &*(0xdeadbeef as *int);
141+
//~^ ERROR raw pointers cannot be dereferenced in statics
142+
140143
pub fn main() {
141144
let y = { static x: Box<isize> = box 3; x };
142145
//~^ ERROR allocations are not allowed in statics

0 commit comments

Comments
 (0)