Auto merge of #919 - RalfJung:wide-raw, r=RalfJung
test for invalid wide raw ptr This is the Miri side of https://github.com/rust-lang/rust/pull/63880.
This commit is contained in:
commit
0fd757ea09
2 changed files with 9 additions and 1 deletions
|
|
@ -1 +1 @@
|
|||
0444b9f66acb5da23dc816e0d8eb59623ba9ea50
|
||||
7445622bcb515c822a2fc6e8c57c90478c1a56bb
|
||||
|
|
|
|||
8
tests/compile-fail/validity/invalid_wide_raw.rs
Normal file
8
tests/compile-fail/validity/invalid_wide_raw.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fn main() {
|
||||
trait T { }
|
||||
#[derive(Debug)]
|
||||
struct S {
|
||||
x: * mut dyn T
|
||||
}
|
||||
dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); //~ ERROR: encountered dangling or unaligned vtable pointer
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue