Eagerly check for accidentally registered region constraints instead of waiting until borrowck is done

This commit is contained in:
Oli Scherer 2024-03-25 10:34:03 +00:00
parent 19bd91d128
commit b2b5fa825d

View File

@ -39,6 +39,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
let TypeOpOutput { output, constraints, error_info } =
op.fully_perform(self.infcx, locations.span(self.body))?;
if cfg!(debug_assertions) {
let data = self.infcx.take_and_reset_region_constraints();
if !data.is_empty() {
panic!("leftover region constraints: {data:#?}");
}
}
debug!(?output, ?constraints);