From 0736dd9dfe4a86e1c8782a9823555b52acc417a3 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 14 Nov 2019 17:13:07 +0900 Subject: [PATCH] Rustup rust-lang/rust#66233 --- clippy_lints/src/consts.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index fc5c8b2e379d..de1c61a6f633 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -474,7 +474,7 @@ 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::Raw { data: d, .. }) => match result.ty.kind { + ty::ConstKind::Value(ConstValue::Scalar(Scalar::Raw { data: d, .. })) => match result.ty.kind { 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( @@ -492,7 +492,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option { // FIXME: implement other conversions. _ => None, }, - ConstValue::Slice { data, start, end } => match result.ty.kind { + ty::ConstKind::Value(ConstValue::Slice { data, start, end }) => match result.ty.kind { ty::Ref(_, tam, _) => match tam.kind { ty::Str => String::from_utf8( data.inspect_with_undef_and_ptr_outside_interpreter(start..end)