| 1 |
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types |
| 2 |
--> tests/ui-msrv/transmute-mut-size-decrease.rs:17:32 |
| 3 |
| |
| 4 |
17 | const DECREASE_SIZE: &mut u8 = transmute_mut!(&mut [0u8; 2]); |
| 5 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 |
| |
| 7 |
= note: source type: `[u8; 2]` (16 bits) |
| 8 |
= note: target type: `u8` (8 bits) |
| 9 |
= note: this error originates in the macro `$crate::assert_size_eq` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 10 |
|
| 11 |
error[E0658]: mutable references are not allowed in constants |
| 12 |
--> tests/ui-msrv/transmute-mut-size-decrease.rs:17:47 |
| 13 |
| |
| 14 |
17 | const DECREASE_SIZE: &mut u8 = transmute_mut!(&mut [0u8; 2]); |
| 15 |
| ^^^^^^^^^^^^^ |
| 16 |
| |
| 17 |
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information |
| 18 |
|
| 19 |
error[E0015]: cannot call non-const fn `transmute_mut::<[u8; 2], u8>` in constants |
| 20 |
--> tests/ui-msrv/transmute-mut-size-decrease.rs:17:32 |
| 21 |
| |
| 22 |
17 | const DECREASE_SIZE: &mut u8 = transmute_mut!(&mut [0u8; 2]); |
| 23 |
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 24 |
| |
| 25 |
= note: calls in constants are limited to constant functions, tuple structs and tuple variants |
| 26 |
= note: this error originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 27 |
|
| 28 |
error[E0716]: temporary value dropped while borrowed |
| 29 |
--> tests/ui-msrv/transmute-mut-size-decrease.rs:17:52 |
| 30 |
| |
| 31 |
17 | const DECREASE_SIZE: &mut u8 = transmute_mut!(&mut [0u8; 2]); |
| 32 |
| --------------------^^^^^^^^- |
| 33 |
| | | |
| 34 |
| | creates a temporary which is freed while still in use |
| 35 |
| temporary value is freed at the end of this statement |
| 36 |
| using this value as a constant requires that borrow lasts for `'static` |