Skip to content

Commit 86d69f9

Browse files
authored
Rollup merge of rust-lang#117439 - lcnr:prepopulate-earlier, r=compiler-errors
prepopulate opaque ty storage before using it doesn't have any significant impact rn afaict, as we freely define new opaque types during MIR typeck. It will be relevant with rust-lang#117278 and once we stop allowing the definition of new opaques in MIR typeck r? `@compiler-errors`
2 parents 290daf9 + 078144e commit 86d69f9

File tree

1 file changed

+8
-6
lines changed
  • compiler/rustc_borrowck/src/type_check

1 file changed

+8
-6
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
188188
&mut borrowck_context,
189189
);
190190

191-
// FIXME(-Ztrait-solver=next): A bit dubious that we're only registering
192-
// predefined opaques in the typeck root.
193-
if infcx.next_trait_solver() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
194-
checker.register_predefined_opaques_in_new_solver();
195-
}
191+
checker.check_user_type_annotations();
196192

197193
let mut verifier = TypeVerifier::new(&mut checker, promoted);
198194
verifier.visit_body(&body);
@@ -1021,7 +1017,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10211017
borrowck_context,
10221018
reported_errors: Default::default(),
10231019
};
1024-
checker.check_user_type_annotations();
1020+
1021+
// FIXME(-Ztrait-solver=next): A bit dubious that we're only registering
1022+
// predefined opaques in the typeck root.
1023+
if infcx.next_trait_solver() && !infcx.tcx.is_typeck_child(body.source.def_id()) {
1024+
checker.register_predefined_opaques_in_new_solver();
1025+
}
1026+
10251027
checker
10261028
}
10271029

0 commit comments

Comments
 (0)