Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 14, 2019
1 parent 0574d66 commit 0736dd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
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(
Expand All @@ -492,7 +492,7 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
// 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)
Expand Down

0 comments on commit 0736dd9

Please sign in to comment.