Skip to content

Commit 57dd22b

Browse files
committed
Suggest into to convert into isize only if uint is of width 8
Since Into<isize> is not implemented for uint of width greater than 8
1 parent 1f0a864 commit 57dd22b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc_typeck/check/demand.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,12 +770,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
770770
(&ty::Int(exp), &ty::Uint(found)) => {
771771
let is_fallible = match (exp.bit_width(), found.bit_width()) {
772772
(Some(exp), Some(found)) if found < exp => false,
773-
(None, Some(found)) if found <= 16 => false,
774-
_ => true
773+
(None, Some(8)) => false,
774+
_ => true,
775775
};
776776
suggest_to_change_suffix_or_into(err, is_fallible);
777777
true
778-
},
778+
}
779779
(&ty::Uint(_), &ty::Int(_)) => {
780780
suggest_to_change_suffix_or_into(err, true);
781781
true

0 commit comments

Comments
 (0)