warning: casting `u32` to `u64` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:17
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u64::from(impl_ints!( u64 => u32; 0x0000_0000_FFFF_FFFF))`
...
25 | impl_ints!( u64 => u32; 0x0000_0000_FFFF_FFFF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
note: the lint level is defined here
--> ./tests/ui/const_prop/ice-issue-96944.rs:1:9
|
1 | #![warn(clippy::cast_lossless)]
| ^^^^^^^^^^^^^^^^^^^^^
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: casting `u32` to `u64` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:52
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^ help: try: `u64::from(impl_ints!( u64 => u32; 0x0000_0000_FFFF_FFFF))`
...
25 | impl_ints!( u64 => u32; 0x0000_0000_FFFF_FFFF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: casting `u16` to `u32` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:17
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::from(impl_ints!( u32 => u16; 0x0000_FFFF))`
...
26 | impl_ints!( u32 => u16; 0x0000_FFFF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: casting `u16` to `u32` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:52
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^ help: try: `u32::from(impl_ints!( u32 => u16; 0x0000_FFFF))`
...
26 | impl_ints!( u32 => u16; 0x0000_FFFF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: casting `u8` to `u16` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:17
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u16::from(impl_ints!( u16 => u8; 0x00FF))`
...
27 | impl_ints!( u16 => u8; 0x00FF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: casting `u8` to `u16` may become silently lossy if you later change the type
--> ./tests/ui/const_prop/ice-issue-96944.rs:18:52
|
18 | (halves[0] << HALF_SIZE) as $int | halves[1] as $int
| ^^^^^^^^^ help: try: `u16::from(impl_ints!( u16 => u8; 0x00FF))`
...
27 | impl_ints!( u16 => u8; 0x00FF);
| ------------------------------------------------------------------ in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
= note: this warning originates in the macro `impl_ints` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 6 warnings emitted
Summary
.
Lint Name
cast_lossless
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Version
Additional Labels
No response