]> git.lizzy.rs Git - rust.git/blob - src/test/ui/transmute/main.stderr
Allow transmutes between the same types after erasing lifetimes
[rust.git] / src / test / ui / transmute / main.stderr
1 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
2   --> $DIR/main.rs:17:17
3    |
4 LL |     let x: u8 = transmute(10u16);
5    |                 ^^^^^^^^^
6    |
7    = note: source type: `u16` (16 bits)
8    = note: target type: `u8` (8 bits)
9
10 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
11   --> $DIR/main.rs:21:17
12    |
13 LL |     let x: u8 = transmute("test");
14    |                 ^^^^^^^^^
15    |
16    = note: source type: `&str` ($STR bits)
17    = note: target type: `u8` (8 bits)
18
19 error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
20   --> $DIR/main.rs:26:18
21    |
22 LL |     let x: Foo = transmute(10);
23    |                  ^^^^^^^^^
24    |
25    = note: source type: `i32` (32 bits)
26    = note: target type: `Foo` (0 bits)
27
28 error: aborting due to 3 previous errors
29
30 For more information about this error, try `rustc --explain E0512`.