]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-26480.stderr
Rollup merge of #66569 - pietroalbini:gha-1, r=alexcrichton
[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 help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit
11    |
12 LL |                   ($arr.len() * size_of($arr[0])).try_into().unwrap());
13    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14
15 error[E0605]: non-primitive cast: `{integer}` as `()`
16   --> $DIR/issue-26480.rs:22:19
17    |
18 LL |     ($x:expr) => ($x as ())
19    |                   ^^^^^^^^
20 ...
21 LL |     cast!(2);
22    |     --------- in this macro invocation
23    |
24    = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
25
26 error: aborting due to 2 previous errors
27
28 Some errors have detailed explanations: E0308, E0605.
29 For more information about an error, try `rustc --explain E0308`.