• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1error[E0308]: mismatched types
2  --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:17:53
3   |
417 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize);
5   |                                      ---------------^^^^^^-
6   |                                      |              |
7   |                                      |              expected `&mut _`, found `usize`
8   |                                      expected due to this
9   |
10   = note: expected mutable reference `&mut _`
11                           found type `usize`
12help: consider mutably borrowing here
13   |
1417 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(&mut 0usize);
15   |                                                     ++++
16
17warning: this function depends on never type fallback being `()`
18  --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:17:1
19   |
2017 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize);
21   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22   |
23   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24   = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
25   = help: specify the types explicitly
26note: in edition 2024, the requirement `!: FromBytes` will fail
27  --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:17:38
28   |
2917 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize);
30   |                                      ^^^^^^^^^^^^^^^^^^^^^^
31   = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
32   = note: this warning originates in the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
33
34warning: never type fallback affects this call to an `unsafe` function
35  --> tests/ui-nightly/transmute-mut-src-not-a-reference.rs:17:38
36   |
3717 | const SRC_NOT_A_REFERENCE: &mut u8 = transmute_mut!(0usize);
38   |                                      ^^^^^^^^^^^^^^^^^^^^^^
39   |
40   = warning: this will change its meaning in a future release!
41   = note: for more information, see issue #123748 <https://github.com/rust-lang/rust/issues/123748>
42   = help: specify the type explicitly
43   = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default
44   = note: this warning originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
45