Skip to content

Commit 078144e

Browse files
committed
prepopulate opaque ty storage before using it :>
1 parent ffb7ed9 commit 078144e

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

+8-6
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)