rust/tests/ui/transmute/main.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
942 B
Plaintext
Raw Normal View History

2018-12-21 14:15:47 +00:00
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/main.rs:17:17
|
2019-03-09 12:03:44 +00:00
LL | let x: u8 = transmute(10u16);
| ^^^^^^^^^
|
2018-12-21 14:15:47 +00:00
= note: source type: `u16` (16 bits)
= note: target type: `u8` (8 bits)
2018-12-21 14:15:47 +00:00
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/main.rs:21:17
|
2019-03-09 12:03:44 +00:00
LL | let x: u8 = transmute("test");
| ^^^^^^^^^
|
= note: source type: `&str` ($STR bits)
2018-12-21 14:15:47 +00:00
= note: target type: `u8` (8 bits)
2018-12-21 14:15:47 +00:00
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/main.rs:26:18
|
2019-03-09 12:03:44 +00:00
LL | let x: Foo = transmute(10);
| ^^^^^^^^^
|
2018-12-21 14:15:47 +00:00
= note: source type: `i32` (32 bits)
= note: target type: `Foo` (0 bits)
error: aborting due to 3 previous errors
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0512`.