Skip to content

Commit a05f18e

Browse files
committed
Auto merge of #4152 - matthiaskrgr:rustup_4, r=matthiaskrgr
rustup rust-lang/rust#61164 (which is included in rust-lang/rust#61274) changelog: none
2 parents fb33fad + c9cc11e commit a05f18e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

clippy_lints/src/consts.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -472,18 +472,18 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
472472
pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
473473
use rustc::mir::interpret::{ConstValue, Scalar};
474474
match result.val {
475-
ConstValue::Scalar(Scalar::Bits { bits: b, .. }) => match result.ty.sty {
476-
ty::Bool => Some(Constant::Bool(b == 1)),
477-
ty::Uint(_) | ty::Int(_) => Some(Constant::Int(b)),
475+
ConstValue::Scalar(Scalar::Raw { data: d, .. }) => match result.ty.sty {
476+
ty::Bool => Some(Constant::Bool(d == 1)),
477+
ty::Uint(_) | ty::Int(_) => Some(Constant::Int(d)),
478478
ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(
479-
b.try_into().expect("invalid f32 bit representation"),
479+
d.try_into().expect("invalid f32 bit representation"),
480480
))),
481481
ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits(
482-
b.try_into().expect("invalid f64 bit representation"),
482+
d.try_into().expect("invalid f64 bit representation"),
483483
))),
484484
ty::RawPtr(type_and_mut) => {
485485
if let ty::Uint(_) = type_and_mut.ty.sty {
486-
return Some(Constant::RawPtr(b));
486+
return Some(Constant::RawPtr(d));
487487
}
488488
None
489489
},

0 commit comments

Comments
 (0)