mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 23:20:39 +00:00
Remove Allocation::bytes
This commit is contained in:
parent
a3fcaee562
commit
7d30cb6e76
1 changed files with 6 additions and 3 deletions
|
@ -490,7 +490,10 @@ 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(
|
||||||
|
data.inspect_with_undef_and_ptr_outside_interpreter(start..end)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
.ok()
|
.ok()
|
||||||
.map(Constant::Str),
|
.map(Constant::Str),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|
Loading…
Reference in a new issue