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