Remove extra indirection in LitKind::ByteStr
This commit is contained in:
parent
4ccf5f731b
commit
5ab19676ed
4 changed files with 5 additions and 8 deletions
|
@ -31,7 +31,7 @@ crate fn lit_to_const<'tcx>(
|
|||
(ast::LitKind::ByteStr(data), ty::Ref(_, inner_ty, _))
|
||||
if matches!(inner_ty.kind(), ty::Slice(_)) =>
|
||||
{
|
||||
let allocation = Allocation::from_byte_aligned_bytes(data as &Vec<u8>);
|
||||
let allocation = Allocation::from_byte_aligned_bytes(data as &[u8]);
|
||||
let allocation = tcx.intern_const_alloc(allocation);
|
||||
ConstValue::Slice { data: allocation, start: 0, end: data.len() }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue