Replace as casts with type-conversion functions.

https://github.com/rust-lang-nursery/rust-clippy/wiki#cast_lossless
This commit is contained in:
Dan Gohman
2017-07-13 16:37:07 -07:00
parent af74cdf364
commit 0cacba15b9
12 changed files with 42 additions and 34 deletions

View File

@@ -1115,7 +1115,7 @@ impl<'a> Parser<'a> {
if bytes < 0 {
return err!(self.loc, "negative stack slot size");
}
if bytes > u32::MAX as i64 {
if bytes > i64::from(u32::MAX) {
return err!(self.loc, "stack slot too large");
}
let mut data = StackSlotData::new(kind, bytes as u32);