Auto merge of #4493 - JohnTitor:fix-build-bytes, r=flip1995
Rustup to rust-lang/rust#63561 changelog: none
This commit is contained in:
commit
2d7da04e17
@ -490,9 +490,12 @@ pub fn miri_to_const(result: &ty::Const<'_>) -> Option<Constant> {
|
|||||||
},
|
},
|
||||||
ConstValue::Slice { data, start, end } => match result.ty.sty {
|
ConstValue::Slice { data, start, end } => match result.ty.sty {
|
||||||
ty::Ref(_, tam, _) => match tam.sty {
|
ty::Ref(_, tam, _) => match tam.sty {
|
||||||
ty::Str => String::from_utf8(data.bytes[start..end].to_owned())
|
ty::Str => String::from_utf8(
|
||||||
.ok()
|
data.inspect_with_undef_and_ptr_outside_interpreter(start..end)
|
||||||
.map(Constant::Str),
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.ok()
|
||||||
|
.map(Constant::Str),
|
||||||
_ => None,
|
_ => None,
|
||||||
},
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
|
Loading…
Reference in New Issue
Block a user