]> git.proxmox.com Git - rustc.git/blame - src/test/ui/consts/issue-79690.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / consts / issue-79690.rs
CommitLineData
5869c6ff
XL
1// ignore-32bit
2// This test gives a different error on 32-bit architectures.
cdc7bbd5 3// stderr-per-bitwidth
5869c6ff
XL
4
5union Transmute<T: Copy, U: Copy> {
6 t: T,
7 u: U,
8}
9trait Bar {
10 fn bar(&self) -> u32;
11}
12struct Foo {
13 foo: u32,
14 bar: bool,
15}
16impl Bar for Foo {
17 fn bar(&self) -> u32 {
18 self.foo
19 }
20}
21#[derive(Copy, Clone)]
22struct Fat<'a>(&'a Foo, &'static VTable);
23struct VTable {
24 size: Foo,
25}
26const FOO: &dyn Bar = &Foo {
27 foo: 128,
28 bar: false,
29};
30const G: Fat = unsafe { Transmute { t: FOO }.u };
31//~^ ERROR it is undefined behavior to use this value
32
33fn main() {}