• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1error[E0308]: mismatched types
2  --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:49
3   |
417 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize);
5   |                                  ---------------^^^^^^-
6   |                                  |              |
7   |                                  |              expected `&_`, found `usize`
8   |                                  expected due to this
9   |
10   = note: expected reference `&_`
11                   found type `usize`
12help: consider borrowing here
13   |
1417 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(&0usize);
15   |                                                 +
16
17warning: this function depends on never type fallback being `()`
18  --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:1
19   |
2017 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize);
21   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22   |
23   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in Rust 2024 and in a future release in all editions!
24   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
25   = help: specify the types explicitly
26note: in edition 2024, the requirement `!: IntoBytes` will fail
27  --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:34
28   |
2917 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize);
30   |                                  ^^^^^^^^^^^^^^^^^^^^^^
31   = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
32   = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
33help: use `()` annotations to avoid fallback changes
34  --> src/macros.rs
35   |
36   |         let e: &() = $e;
37   |                 ~~
38
39warning: never type fallback affects this call to an `unsafe` function
40  --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:34
41   |
4217 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize);
43   |                                  ^^^^^^^^^^^^^^^^^^^^^^
44   |
45   = warning: this changes meaning in Rust 2024 and in a future release in all editions!
46   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
47   = help: specify the type explicitly
48   = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default
49   = note: this warning originates in the macro `$crate::assert_size_eq` which comes from the expansion of the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
50
51warning: never type fallback affects this call to an `unsafe` function
52  --> tests/ui-stable/transmute-ref-src-not-a-reference.rs:17:34
53   |
5417 | const SRC_NOT_A_REFERENCE: &u8 = transmute_ref!(0usize);
55   |                                  ^^^^^^^^^^^^^^^^^^^^^^
56   |
57   = warning: this changes meaning in Rust 2024 and in a future release in all editions!
58   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
59   = help: specify the type explicitly
60   = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
61