Skip to content

Commit f2efd72

Browse files
committed
Add ICE reproduction for issue rust-lang/rust#79690.
1 parent f0d8818 commit f2efd72

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ices/79690.rs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
union Transmute<T: Copy, U: Copy> {
2+
t: T,
3+
u: U,
4+
}
5+
trait Bar {
6+
fn bar(&self) -> u32;
7+
}
8+
struct Foo {
9+
foo: u32,
10+
bar: bool,
11+
}
12+
impl Bar for Foo {
13+
fn bar(&self) -> u32 {
14+
self.foo
15+
}
16+
}
17+
#[derive(Copy, Clone)]
18+
struct Fat<'a>(&'a Foo, &'static VTable);
19+
struct VTable {
20+
size: Foo,
21+
}
22+
const FOO: &Bar = &Foo {
23+
foo: 128,
24+
bar: false,
25+
};
26+
const G: Fat = unsafe { Transmute { t: FOO }.u };

0 commit comments

Comments
 (0)