Skip to content

Commit 74aad5c

Browse files
committed
Adt for Unique may contain a reference
1 parent 6fc0273 commit 74aad5c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/add_retag.rs

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

0 commit comments

Comments
 (0)