mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
Rustup rust-lang/rust#66233
This commit is contained in:
parent
0574d6612c
commit
0736dd9dfe
1 changed files with 2 additions and 2 deletions
|
@ -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(
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue