Skip to content

Commit

Permalink
Auto merge of #919 - RalfJung:wide-raw, r=RalfJung
Browse files Browse the repository at this point in the history
test for invalid wide raw ptr

This is the Miri side of rust-lang/rust#63880.
  • Loading branch information
bors committed Aug 29, 2019
2 parents ee8afea + 5483531 commit 0fd757e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0444b9f66acb5da23dc816e0d8eb59623ba9ea50
7445622bcb515c822a2fc6e8c57c90478c1a56bb
8 changes: 8 additions & 0 deletions tests/compile-fail/validity/invalid_wide_raw.rs
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 0fd757e

Please # to comment.