This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +157
-100
lines changed Expand file tree Collapse file tree 2 files changed +157
-100
lines changed Original file line number Diff line number Diff line change 11//@no-rustfix
22
33#![ feature( repr128) ]
4+ #![ feature( isqrt) ]
45#![ allow( incomplete_features) ]
56#![ warn(
67 clippy:: cast_precision_loss,
@@ -149,8 +150,8 @@ fn main() {
149150 ( -1isize ) . checked_isqrt ( ) . expect ( "-1 is a small number" ) as usize ;
150151
151152 ( -1i8 ) . rem_euclid ( 1i8 ) as u8 ;
152- ( -1i8 ) . wrapping_rem_euclid ( 1i8 ) . unwrap ( ) as u16 ;
153- ( -1i16 ) . rem_euclid ( 1i16 ) . unwrap ( ) as u16 ;
153+ ( -1i8 ) . wrapping_rem_euclid ( 1i8 ) as u16 ;
154+ ( -1i16 ) . rem_euclid ( 1i16 ) as u16 ;
154155 ( -1i16 ) . rem_euclid ( 1i16 ) as u32 ;
155156 ( -1i32 ) . rem_euclid ( 1i32 ) as u32 ;
156157 ( -1i32 ) . rem_euclid ( 1i32 ) as u64 ;
@@ -400,11 +401,11 @@ fn issue11642() {
400401 ( -2_i32 ) . pow ( 3 ) as u32 ;
401402 //~^ ERROR: casting `i32` to `u32` may lose the sign of the value
402403
403- ( 2_i32 % 1 ) as u32 ;
404- ( 2_i32 % -1 ) as u32 ;
405- ( -2_i32 % 1 ) as u32 ;
404+ ( 3_i32 % 2 ) as u32 ;
405+ ( 3_i32 % -2 ) as u32 ;
406+ ( -5_i32 % 2 ) as u32 ;
406407 //~^ ERROR: casting `i32` to `u32` may lose the sign of the value
407- ( -2_i32 % -1 ) as u32 ;
408+ ( -5_i32 % -2 ) as u32 ;
408409 //~^ ERROR: casting `i32` to `u32` may lose the sign of the value
409410 ( 2_i32 >> 1 ) as u32 ;
410411 ( -2_i32 >> 1 ) as u32 ;
You can’t perform that action at this time.
0 commit comments