Skip to content

Commit

Permalink
Auto merge of #4815 - JohnTitor:rustup, r=matthiaskrgr
Browse files Browse the repository at this point in the history
Rustup rust-lang/rust#66233

changelog: none
  • Loading branch information
bors committed Nov 14, 2019
2 parents 0574d66 + 0736dd9 commit b4f1769
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 b4f1769

Please sign in to comment.