|
60 | 60 | //! imply that `'b: 'a`. |
61 | 61 |
|
62 | 62 | use crate::infer::outlives::components::{push_outlives_components, Component}; |
63 | | -use crate::infer::outlives::env::OutlivesEnvironment; |
64 | 63 | use crate::infer::outlives::env::RegionBoundPairs; |
65 | 64 | use crate::infer::outlives::verify::VerifyBoundCx; |
66 | 65 | use crate::infer::{ |
67 | 66 | self, GenericKind, InferCtxt, RegionObligation, SubregionOrigin, UndoLog, VerifyBound, |
68 | 67 | }; |
69 | 68 | use crate::traits::{ObligationCause, ObligationCauseCode}; |
70 | 69 | use rustc_data_structures::undo_log::UndoLogs; |
71 | | -use rustc_errors::ErrorGuaranteed; |
72 | 70 | use rustc_hir::def_id::DefId; |
73 | | -use rustc_hir::def_id::LocalDefId; |
74 | 71 | use rustc_middle::mir::ConstraintCategory; |
75 | 72 | use rustc_middle::ty::subst::GenericArgKind; |
76 | 73 | use rustc_middle::ty::{self, Region, SubstsRef, Ty, TyCtxt, TypeVisitable}; |
@@ -116,7 +113,7 @@ impl<'tcx> InferCtxt<'tcx> { |
116 | 113 | std::mem::take(&mut self.inner.borrow_mut().region_obligations) |
117 | 114 | } |
118 | 115 |
|
119 | | - /// NOTE: Prefer using [`InferCtxt::check_region_obligations_and_report_errors`] |
| 116 | + /// NOTE: Prefer using `TypeErrCtxt::check_region_obligations_and_report_errors` |
120 | 117 | /// instead of calling this directly. |
121 | 118 | /// |
122 | 119 | /// Process the region obligations that must be proven (during |
@@ -170,22 +167,6 @@ impl<'tcx> InferCtxt<'tcx> { |
170 | 167 | outlives.type_must_outlive(origin, sup_type, sub_region, category); |
171 | 168 | } |
172 | 169 | } |
173 | | - |
174 | | - /// Processes registered region obliations and resolves regions, reporting |
175 | | - /// any errors if any were raised. Prefer using this function over manually |
176 | | - /// calling `resolve_regions_and_report_errors`. |
177 | | - pub fn check_region_obligations_and_report_errors( |
178 | | - &self, |
179 | | - generic_param_scope: LocalDefId, |
180 | | - outlives_env: &OutlivesEnvironment<'tcx>, |
181 | | - ) -> Result<(), ErrorGuaranteed> { |
182 | | - self.process_registered_region_obligations( |
183 | | - outlives_env.region_bound_pairs(), |
184 | | - outlives_env.param_env, |
185 | | - ); |
186 | | - |
187 | | - self.err_ctxt().resolve_regions_and_report_errors(generic_param_scope, outlives_env) |
188 | | - } |
189 | 170 | } |
190 | 171 |
|
191 | 172 | /// The `TypeOutlives` struct has the job of "lowering" a `T: 'a` |
|
0 commit comments