diff options
| author | bors <bors@rust-lang.org> | 2025-09-08 16:29:57 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-09-08 16:29:57 +0000 | 
| commit | a78f9aa87fa828ad4a5c11f1e3b93e94d9352ad6 (patch) | |
| tree | e7709e65dd1b25727fa22d71e68b5377250464aa /compiler/rustc_middle/src/ty/visit.rs | |
| parent | 68baa87ba6f03f8b6af2a368690161f1601e4040 (diff) | |
| parent | 65e4c547bf1f0d64c5443e2199ab2b000ef9ba6e (diff) | |
| download | rust-a78f9aa87fa828ad4a5c11f1e3b93e94d9352ad6.tar.gz rust-a78f9aa87fa828ad4a5c11f1e3b93e94d9352ad6.zip  | |
Auto merge of #146333 - matthiaskrgr:rollup-ib80jyw, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang/rust#146111 (Migrate more things in the new solver to specific `DefId`s) - rust-lang/rust#146298 (GVN: Ensure indirect is first projection in try_as_place.) - rust-lang/rust#146299 (docs(std): add error docs for path canonicalize) - rust-lang/rust#146310 (Allow static regions in `type_name`.) - rust-lang/rust#146313 (Some `rustc_middle` cleanups) - rust-lang/rust#146319 (Fix typo in default.rs) - rust-lang/rust#146320 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src/ty/visit.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/visit.rs | 39 | 
1 files changed, 0 insertions, 39 deletions
diff --git a/compiler/rustc_middle/src/ty/visit.rs b/compiler/rustc_middle/src/ty/visit.rs index 3853a804a92..f0c47f257cc 100644 --- a/compiler/rustc_middle/src/ty/visit.rs +++ b/compiler/rustc_middle/src/ty/visit.rs @@ -212,42 +212,3 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for LateBoundRegionsCollector { } } } - -/// Finds the max universe present -pub struct MaxUniverse { - max_universe: ty::UniverseIndex, -} - -impl MaxUniverse { - pub fn new() -> Self { - MaxUniverse { max_universe: ty::UniverseIndex::ROOT } - } - - pub fn max_universe(self) -> ty::UniverseIndex { - self.max_universe - } -} - -impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for MaxUniverse { - fn visit_ty(&mut self, t: Ty<'tcx>) { - if let ty::Placeholder(placeholder) = t.kind() { - self.max_universe = self.max_universe.max(placeholder.universe); - } - - t.super_visit_with(self) - } - - fn visit_const(&mut self, c: ty::consts::Const<'tcx>) { - if let ty::ConstKind::Placeholder(placeholder) = c.kind() { - self.max_universe = self.max_universe.max(placeholder.universe); - } - - c.super_visit_with(self) - } - - fn visit_region(&mut self, r: ty::Region<'tcx>) { - if let ty::RePlaceholder(placeholder) = r.kind() { - self.max_universe = self.max_universe.max(placeholder.universe); - } - } -}  | 
