Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test for invalid wide raw ptr #919

Merged
merged 2 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}