|
| 1 | +error: casts from `u8` to `u16` can be expressed infallibly using `From` |
| 2 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 3 | + | |
| 4 | +LL | data[0] as $int |
| 5 | + | ^^^^^^^^^^^^^^^ |
| 6 | +... |
| 7 | +LL | let _ = zero!(u16); |
| 8 | + | ---------- in this macro invocation |
| 9 | + | |
| 10 | + = help: an `as` cast can become silently lossy if the types change in the future |
| 11 | +help: use `<u16>::from` instead |
| 12 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 13 | + | |
| 14 | +LL | data[0] as $int |
| 15 | + | ^^^^^^^^^^^^^^^ |
| 16 | +... |
| 17 | +LL | let _ = zero!(u16); |
| 18 | + | ---------- in this macro invocation |
| 19 | + = note: `-D clippy::cast-lossless` implied by `-D warnings` |
| 20 | + = help: to override `-D warnings` add `#[allow(clippy::cast_lossless)]` |
| 21 | + = note: this error originates in the macro `zero` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 22 | + |
| 23 | +error: casts from `u8` to `u32` can be expressed infallibly using `From` |
| 24 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 25 | + | |
| 26 | +LL | data[0] as $int |
| 27 | + | ^^^^^^^^^^^^^^^ |
| 28 | +... |
| 29 | +LL | let _ = zero!(u32); |
| 30 | + | ---------- in this macro invocation |
| 31 | + | |
| 32 | + = help: an `as` cast can become silently lossy if the types change in the future |
| 33 | +help: use `<u32>::from` instead |
| 34 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 35 | + | |
| 36 | +LL | data[0] as $int |
| 37 | + | ^^^^^^^^^^^^^^^ |
| 38 | +... |
| 39 | +LL | let _ = zero!(u32); |
| 40 | + | ---------- in this macro invocation |
| 41 | + = note: this error originates in the macro `zero` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 42 | + |
| 43 | +error: casts from `u8` to `u64` can be expressed infallibly using `From` |
| 44 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 45 | + | |
| 46 | +LL | data[0] as $int |
| 47 | + | ^^^^^^^^^^^^^^^ |
| 48 | +... |
| 49 | +LL | let _ = zero!(u64); |
| 50 | + | ---------- in this macro invocation |
| 51 | + | |
| 52 | + = help: an `as` cast can become silently lossy if the types change in the future |
| 53 | +help: use `<u64>::from` instead |
| 54 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 55 | + | |
| 56 | +LL | data[0] as $int |
| 57 | + | ^^^^^^^^^^^^^^^ |
| 58 | +... |
| 59 | +LL | let _ = zero!(u64); |
| 60 | + | ---------- in this macro invocation |
| 61 | + = note: this error originates in the macro `zero` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 62 | + |
| 63 | +error: casts from `u8` to `u128` can be expressed infallibly using `From` |
| 64 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 65 | + | |
| 66 | +LL | data[0] as $int |
| 67 | + | ^^^^^^^^^^^^^^^ |
| 68 | +... |
| 69 | +LL | let _ = zero!(u128); |
| 70 | + | ----------- in this macro invocation |
| 71 | + | |
| 72 | + = help: an `as` cast can become silently lossy if the types change in the future |
| 73 | +help: use `<u128>::from` instead |
| 74 | + --> tests/ui/cast_lossless_integer_unfixable.rs:7:13 |
| 75 | + | |
| 76 | +LL | data[0] as $int |
| 77 | + | ^^^^^^^^^^^^^^^ |
| 78 | +... |
| 79 | +LL | let _ = zero!(u128); |
| 80 | + | ----------- in this macro invocation |
| 81 | + = note: this error originates in the macro `zero` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 82 | + |
| 83 | +error: aborting due to 4 previous errors |
| 84 | + |
0 commit comments