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
This commit is contained in:
parent
1f0a864570
commit
57dd22baad
@ -770,12 +770,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
(&ty::Int(exp), &ty::Uint(found)) => {
|
||||
let is_fallible = match (exp.bit_width(), found.bit_width()) {
|
||||
(Some(exp), Some(found)) if found < exp => false,
|
||||
(None, Some(found)) if found <= 16 => false,
|
||||
_ => true
|
||||
(None, Some(8)) => false,
|
||||
_ => true,
|
||||
};
|
||||
suggest_to_change_suffix_or_into(err, is_fallible);
|
||||
true
|
||||
},
|
||||
}
|
||||
(&ty::Uint(_), &ty::Int(_)) => {
|
||||
suggest_to_change_suffix_or_into(err, true);
|
||||
true
|
||||
|
Loading…
Reference in New Issue
Block a user