diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2023-06-21 07:37:03 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-21 07:37:03 +0200 |
| commit | 82e6a16e3314469e4cf8e8c65381f7a47a4d294b (patch) | |
| tree | 9b0ab0e170ce78c0e90d935dc55e48c5ac78d85e | |
| parent | 904994e101e9d41d4dbe316fe0cce264a10c8d2b (diff) | |
| parent | 74aad5ce56e685761ed6ea791c542a0097c7b4d7 (diff) | |
| download | rust-82e6a16e3314469e4cf8e8c65381f7a47a4d294b.tar.gz rust-82e6a16e3314469e4cf8e8c65381f7a47a4d294b.zip | |
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``
| -rw-r--r-- | compiler/rustc_mir_transform/src/add_retag.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/add_retag.rs b/compiler/rustc_mir_transform/src/add_retag.rs index 187d38b385b..d9e7339f1b2 100644 --- a/compiler/rustc_mir_transform/src/add_retag.rs +++ b/compiler/rustc_mir_transform/src/add_retag.rs @@ -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. |
