diff options
| author | bors <bors@rust-lang.org> | 2022-09-10 20:54:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-09-10 20:54:01 +0000 |
| commit | 2287107588d92889d282e6cd3c1ca5df34cd34a5 (patch) | |
| tree | efd90ebe87db4b8b9c5642b56e62728829badf29 /compiler/rustc_middle | |
| parent | 4a6ac3c225d6322caaf0ef86623cddc74e5260c6 (diff) | |
| parent | 1e54fcc1adeb3932ea7844ec1f86389a680ab86d (diff) | |
| download | rust-2287107588d92889d282e6cd3c1ca5df34cd34a5.tar.gz rust-2287107588d92889d282e6cd3c1ca5df34cd34a5.zip | |
Auto merge of #98559 - jackh726:remove-reempty, r=oli-obk
Remove ReEmpty r? rust-lang/types
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 8 |
3 files changed, 3 insertions, 24 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 53e91e48c24..afb2d5b2ba5 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -276,9 +276,6 @@ pub struct CommonTypes<'tcx> { } pub struct CommonLifetimes<'tcx> { - /// `ReEmpty` in the root universe. - pub re_root_empty: Region<'tcx>, - /// `ReStatic` pub re_static: Region<'tcx>, @@ -987,11 +984,7 @@ impl<'tcx> CommonLifetimes<'tcx> { )) }; - CommonLifetimes { - re_root_empty: mk(ty::ReEmpty(ty::UniverseIndex::ROOT)), - re_static: mk(ty::ReStatic), - re_erased: mk(ty::ReErased), - } + CommonLifetimes { re_static: mk(ty::ReStatic), re_erased: mk(ty::ReErased) } } } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 5166372878f..301d1f5052e 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1986,7 +1986,7 @@ impl<'tcx> PrettyPrinter<'tcx> for FmtPrinter<'_, 'tcx> { ty::ReVar(_) | ty::ReErased => false, - ty::ReStatic | ty::ReEmpty(_) => true, + ty::ReStatic => true, } } @@ -2070,14 +2070,6 @@ impl<'tcx> FmtPrinter<'_, 'tcx> { p!("'static"); return Ok(self); } - ty::ReEmpty(ty::UniverseIndex::ROOT) => { - p!("'<empty>"); - return Ok(self); - } - ty::ReEmpty(ui) => { - p!(write("'<empty:{:?}>", ui)); - return Ok(self); - } } p!("'_"); diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index c5c5d347341..702c2d27187 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1514,7 +1514,6 @@ impl<'tcx> Region<'tcx> { ty::ReStatic => true, ty::ReVar(..) => false, ty::RePlaceholder(placeholder) => placeholder.name.is_named(), - ty::ReEmpty(_) => false, ty::ReErased => false, } } @@ -1540,11 +1539,6 @@ impl<'tcx> Region<'tcx> { } #[inline] - pub fn is_empty(self) -> bool { - matches!(*self, ty::ReEmpty(..)) - } - - #[inline] pub fn bound_at_or_above_binder(self, index: ty::DebruijnIndex) -> bool { match *self { ty::ReLateBound(debruijn, _) => debruijn >= index, @@ -1575,7 +1569,7 @@ impl<'tcx> Region<'tcx> { flags = flags | TypeFlags::HAS_FREE_REGIONS; flags = flags | TypeFlags::HAS_FREE_LOCAL_REGIONS; } - ty::ReEmpty(_) | ty::ReStatic => { + ty::ReStatic => { flags = flags | TypeFlags::HAS_FREE_REGIONS; } ty::ReLateBound(..) => { |
