Auto merge of #115794 - cjgillot:aggregate-no-box, r=davidtwco

Do not create a DerefLen place for `Box<[T]>`.

Fixes https://github.com/rust-lang/rust/issues/115789
This commit is contained in:
bors 2023-09-24 06:13:17 +00:00
commit 551c7183f8
10 changed files with 956 additions and 1 deletions

View file

@ -758,7 +758,9 @@ impl Map {
self.value_count += 1;
}
if let Some(ref_ty) = ty.builtin_deref(true) && let ty::Slice(..) = ref_ty.ty.kind() {
if let ty::Ref(_, ref_ty, _) | ty::RawPtr(ty::TypeAndMut { ty: ref_ty, .. }) = ty.kind()
&& let ty::Slice(..) = ref_ty.kind()
{
assert!(self.places[place].value_index.is_none(), "slices are not scalars");
// Prepend new child to the linked list.