We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0d8818 commit f2efd72Copy full SHA for f2efd72
ices/79690.rs
@@ -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