From: bors Date: Wed, 29 May 2019 20:01:57 +0000 (+0000) Subject: Auto merge of #4153 - matthiaskrgr:rustup_5, r=flip1995 X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=018fa30c564a47669420d3d00e15abae49d6e32f;hp=22e77dfa981487181b7a89117eb59b2bc04158b5;p=rust.git Auto merge of #4153 - matthiaskrgr:rustup_5, r=flip1995 rustup https://github.com/rust-lang/rust/pull/60928 changelog: none --- diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index ef415f45330..c6831eb928b 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -472,18 +472,18 @@ fn binop(&mut self, op: BinOp, left: &Expr, right: &Expr) -> Option { pub fn miri_to_const(result: &ty::Const<'_>) -> Option { use rustc::mir::interpret::{ConstValue, Scalar}; match result.val { - ConstValue::Scalar(Scalar::Bits { bits: b, .. }) => match result.ty.sty { - ty::Bool => Some(Constant::Bool(b == 1)), - ty::Uint(_) | ty::Int(_) => Some(Constant::Int(b)), + ConstValue::Scalar(Scalar::Raw { data: d, .. }) => match result.ty.sty { + ty::Bool => Some(Constant::Bool(d == 1)), + ty::Uint(_) | ty::Int(_) => Some(Constant::Int(d)), ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits( - b.try_into().expect("invalid f32 bit representation"), + d.try_into().expect("invalid f32 bit representation"), ))), ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits( - b.try_into().expect("invalid f64 bit representation"), + d.try_into().expect("invalid f64 bit representation"), ))), ty::RawPtr(type_and_mut) => { if let ty::Uint(_) = type_and_mut.ty.sty { - return Some(Constant::RawPtr(b)); + return Some(Constant::RawPtr(d)); } None },