Adt for Unique may contain a reference

This commit is contained in:
Neven Villani 2023-06-20 16:30:44 +02:00
parent 6fc0273b5a
commit 74aad5ce56
No known key found for this signature in database
GPG Key ID: 00E765FA7F4F2EDE

View File

@ -28,6 +28,7 @@ fn may_contain_reference<'tcx>(ty: Ty<'tcx>, depth: u32, tcx: TyCtxt<'tcx>) -> b
// References
ty::Ref(..) => true,
ty::Adt(..) if ty.is_box() => true,
ty::Adt(adt, _) if Some(adt.did()) == tcx.lang_items().ptr_unique() => true,
// Compound types: recurse
ty::Array(ty, _) | ty::Slice(ty) => {
// This does not branch so we keep the depth the same.