Skip to content

Commit b2b5fa8

Browse files
committed
Eagerly check for accidentally registered region constraints instead of waiting until borrowck is done
1 parent 19bd91d commit b2b5fa8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_borrowck/src/type_check/canonical.rs

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
3939

4040
let TypeOpOutput { output, constraints, error_info } =
4141
op.fully_perform(self.infcx, locations.span(self.body))?;
42+
if cfg!(debug_assertions) {
43+
let data = self.infcx.take_and_reset_region_constraints();
44+
if !data.is_empty() {
45+
panic!("leftover region constraints: {data:#?}");
46+
}
47+
}
4248

4349
debug!(?output, ?constraints);
4450

0 commit comments

Comments
 (0)