diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-01-28 11:25:15 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-02-15 16:08:52 +1100 |
| commit | 18e7b7ece129d0393bb739cb4f9557689e184080 (patch) | |
| tree | 3502fb68651acb833b75c61bccc871b2ccb64ca5 | |
| parent | 6a20fa93b594a0d166402e811a033c6f1e153cf2 (diff) | |
| download | rust-18e7b7ece129d0393bb739cb4f9557689e184080.tar.gz rust-18e7b7ece129d0393bb739cb4f9557689e184080.zip | |
Overhaul `RegionKind` and `Region`.
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
| -rw-r--r-- | src/abi/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/abi/mod.rs b/src/abi/mod.rs index 72ebc84c1a3..a0550860fa5 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -544,7 +544,7 @@ pub(crate) fn codegen_drop<'tcx>( let arg_value = drop_place.place_ref( fx, fx.layout_of(fx.tcx.mk_ref( - &ty::RegionKind::ReErased, + fx.tcx.lifetimes.re_erased, TypeAndMut { ty, mutbl: crate::rustc_hir::Mutability::Mut }, )), ); |
