• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1error[E0308]: mismatched types
2  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:54
3   |
417 | const SRC_DST_NOT_REFERENCES: usize = 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_DST_NOT_REFERENCES: usize = transmute_ref!(&0usize);
15   |                                                      +
16
17error[E0308]: mismatched types
18  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
19   |
2017 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
21   |                                       ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
22   |
23   = note:   expected type `usize`
24           found reference `&_`
25   = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
26
27error[E0308]: mismatched types
28  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
29   |
3017 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
31   |                                       ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
32   |
33   = note:   expected type `usize`
34           found reference `&_`
35   = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
36
37error[E0308]: mismatched types
38  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
39   |
4017 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
41   |                                       ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
42   |
43   = note:   expected type `usize`
44           found reference `&_`
45   = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
46
47error[E0308]: mismatched types
48  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
49   |
5017 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
51   |                                       ^^^^^^^^^^^^^^^^^^^^^^ expected `usize`, found `&_`
52   |
53   = note:   expected type `usize`
54           found reference `&_`
55   = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
56
57error[E0308]: mismatched types
58  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
59   |
6017 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
61   |                                       ^^^^^^^^^^^^^^^^^^^^^^
62   |                                       |
63   |                                       expected `usize`, found `&_`
64   |                                       arguments to this function are incorrect
65   |
66   = note:   expected type `usize`
67           found reference `&_`
68help: the return type of this call is `&_` due to the type of the argument passed
69  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
70   |
7117 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
72   |                                       ^^^^^^^^^^^^^^^^^^^^^^ this argument influences the return type of `$crate`
73note: function defined here
74  --> src/util/macro_util.rs
75   |
76   | pub const fn must_use<T>(t: T) -> T {
77   |              ^^^^^^^^
78   = note: this error originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
79
80warning: this function depends on never type fallback being `()`
81  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:1
82   |
8317 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
84   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
85   |
86   = 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!
87   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
88   = help: specify the types explicitly
89note: in edition 2024, the requirement `!: IntoBytes` will fail
90  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
91   |
9217 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
93   |                                       ^^^^^^^^^^^^^^^^^^^^^^
94   = note: `#[warn(dependency_on_unit_never_type_fallback)]` on by default
95   = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
96help: use `()` annotations to avoid fallback changes
97  --> src/macros.rs
98   |
99   |         let e: &() = $e;
100   |                 ~~
101
102warning: never type fallback affects this call to an `unsafe` function
103  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
104   |
10517 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
106   |                                       ^^^^^^^^^^^^^^^^^^^^^^
107   |
108   = warning: this changes meaning in Rust 2024 and in a future release in all editions!
109   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
110   = help: specify the type explicitly
111   = note: `#[warn(never_type_fallback_flowing_into_unsafe)]` on by default
112   = 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)
113
114warning: never type fallback affects this call to an `unsafe` function
115  --> tests/ui-stable/transmute-ref-src-dst-not-references.rs:17:39
116   |
11717 | const SRC_DST_NOT_REFERENCES: usize = transmute_ref!(0usize);
118   |                                       ^^^^^^^^^^^^^^^^^^^^^^
119   |
120   = warning: this changes meaning in Rust 2024 and in a future release in all editions!
121   = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/never-type-fallback.html>
122   = help: specify the type explicitly
123   = note: this warning originates in the macro `transmute_ref` (in Nightly builds, run with -Z macro-backtrace for more info)
124