- let id = tcx.allocate_bytes(s.as_bytes());
- return Ok(ty::Const {
- val: ConstValue::new_slice(Scalar::Ptr(id.into()), s.len() as u64),
+ let allocation = Allocation::from_byte_aligned_bytes(s.as_bytes());
+ let allocation = tcx.intern_const_alloc(allocation);
+ return Ok(tcx.mk_const(ty::Const {
+ val: ConstValue::Slice{ data: allocation, start: 0, end: s.len() },