From c9cc11e9fa3cd98d8129a2a91a7859d4a0c0ee81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 28 May 2019 20:47:16 +0200 Subject: [PATCH] rustup https://github.com/rust-lang/rust/pull/61164 (which is included in https://github.com/rust-lang/rust/pull/61274) --- clippy_lints/src/consts.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index ef415f453305..c6831eb928bf 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -472,18 +472,18 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> { 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 },