]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-26480.stderr
Rollup merge of #89953 - woppopo:option_const_as_mut, r=oli-obk
[rust.git] / src / test / ui / mismatched_types / issue-26480.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-26480.rs:16:19
3    |
4 LL |                   $arr.len() * size_of($arr[0]));
5    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
6 ...
7 LL |     write!(hello);
8    |     ------------- in this macro invocation
9    |
10    = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
11 help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
12    |
13 LL |                   ($arr.len() * size_of($arr[0])).try_into().unwrap());
14    |                   +                             +++++++++++++++++++++
15
16 error[E0605]: non-primitive cast: `{integer}` as `()`
17   --> $DIR/issue-26480.rs:22:19
18    |
19 LL |     ($x:expr) => ($x as ())
20    |                   ^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object
21 ...
22 LL |     cast!(2);
23    |     -------- in this macro invocation
24    |
25    = note: this error originates in the macro `cast` (in Nightly builds, run with -Z macro-backtrace for more info)
26
27 error: aborting due to 2 previous errors
28
29 Some errors have detailed explanations: E0308, E0605.
30 For more information about an error, try `rustc --explain E0308`.