Skip to content

Commit 18e7b7e

Browse files
committed
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.
1 parent 6a20fa9 commit 18e7b7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/abi/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ pub(crate) fn codegen_drop<'tcx>(
544544
let arg_value = drop_place.place_ref(
545545
fx,
546546
fx.layout_of(fx.tcx.mk_ref(
547-
&ty::RegionKind::ReErased,
547+
fx.tcx.lifetimes.re_erased,
548548
TypeAndMut { ty, mutbl: crate::rustc_hir::Mutability::Mut },
549549
)),
550550
);

0 commit comments

Comments
 (0)