Eagerly check for accidentally registered region constraints instead of waiting until borrowck is done
This commit is contained in:
parent
19bd91d128
commit
b2b5fa825d
1 changed files with 6 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue