1
Fork 0

Rollup merge of #134827 - compiler-errors:borrowck-nits, r=lqd

Some random region tweaks

Remove a redundant function and add an assertion that I think is useful
This commit is contained in:
David Tolnay 2024-12-27 18:43:04 -08:00 committed by GitHub
commit 2d96f2a48f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View file

@ -140,6 +140,12 @@ pub(crate) fn type_check<'a, 'tcx>(
&mut constraints,
);
let pre_obligations = infcx.take_registered_region_obligations();
assert!(
pre_obligations.is_empty(),
"there should be no incoming region obligations = {pre_obligations:#?}",
);
debug!(?normalized_inputs_and_output);
let mut typeck = TypeChecker {

View file

@ -299,10 +299,6 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
self.storage.var_infos.len()
}
pub fn region_constraint_data(&self) -> &RegionConstraintData<'tcx> {
&self.storage.data
}
/// Takes (and clears) the current set of constraints. Note that
/// the set of variables remains intact, but all relationships
/// between them are reset. This is used during NLL checking to

View file

@ -161,8 +161,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
let outlives_env = OutlivesEnvironment::new(full_env);
let _ = infcx.process_registered_region_obligations(&outlives_env, |ty, _| Ok(ty));
let region_data =
infcx.inner.borrow_mut().unwrap_region_constraints().region_constraint_data().clone();
let region_data = infcx.inner.borrow_mut().unwrap_region_constraints().data().clone();
let vid_to_region = self.map_vid_to_region(&region_data);