Skip to content

Commit 82e6a16

Browse files
authored
Rollup merge of #112844 - Vanille-N:unique, r=RalfJung
Add retag in MIR transform: `Adt` for `Unique` may contain a reference Following #112662 , `may_contain_reference` in `rustc_mir_transform::add_retag` underapproximates too much the types that require retagging. r? ``@RalfJung``
2 parents 904994e + 74aad5c commit 82e6a16

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)