Skip to content

Commit 0bbe705

Browse files
author
Bruno Tavares
committed
ICE because uninhabited types and drop flags don't mix
Reference rust-lang/rust#17987
1 parent 10e8088 commit 0bbe705

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/17987.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
enum Foo {}
2+
impl Drop for Foo {
3+
fn drop(&mut self) {}
4+
}
5+
6+
fn main() {
7+
unsafe { std::ptr::read(&1u8 as *const u8 as *const Foo) };
8+
}

0 commit comments

Comments
 (0)