Skip to content

Commit 4320913

Browse files
committed
normalize_projection_ty is not used with next-solver
1 parent eea58c7 commit 4320913

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

compiler/rustc_traits/src/normalize_projection_ty.rs

+13-14
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ fn normalize_projection_ty<'tcx>(
2525
goal: CanonicalProjectionGoal<'tcx>,
2626
) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, NormalizationResult<'tcx>>>, NoSolution> {
2727
debug!("normalize_provider(goal={:#?})", goal);
28-
2928
tcx.infer_ctxt().enter_canonical_trait_query(
3029
&goal,
3130
|ocx, ParamEnvAnd { param_env, value: goal }| {
31+
debug_assert!(!ocx.infcx.next_trait_solver());
3232
let selcx = &mut SelectionContext::new(ocx.infcx);
3333
let cause = ObligationCause::dummy();
3434
let mut obligations = vec![];
@@ -45,23 +45,22 @@ fn normalize_projection_ty<'tcx>(
4545
// are recursive (given some substitution of the opaque's type variables).
4646
// In that case, we may only realize a cycle error when calling
4747
// `normalize_erasing_regions` in mono.
48-
if !ocx.infcx.next_trait_solver() {
49-
let errors = ocx.select_where_possible();
50-
if !errors.is_empty() {
51-
// Rustdoc may attempt to normalize type alias types which are not
52-
// well-formed. Rustdoc also normalizes types that are just not
53-
// well-formed, since we don't do as much HIR analysis (checking
54-
// that impl vars are constrained by the signature, for example).
55-
if !tcx.sess.opts.actually_rustdoc {
56-
for error in &errors {
57-
if let FulfillmentErrorCode::Cycle(cycle) = &error.code {
58-
ocx.infcx.err_ctxt().report_overflow_obligation_cycle(cycle);
59-
}
48+
let errors = ocx.select_where_possible();
49+
if !errors.is_empty() {
50+
// Rustdoc may attempt to normalize type alias types which are not
51+
// well-formed. Rustdoc also normalizes types that are just not
52+
// well-formed, since we don't do as much HIR analysis (checking
53+
// that impl vars are constrained by the signature, for example).
54+
if !tcx.sess.opts.actually_rustdoc {
55+
for error in &errors {
56+
if let FulfillmentErrorCode::Cycle(cycle) = &error.code {
57+
ocx.infcx.err_ctxt().report_overflow_obligation_cycle(cycle);
6058
}
6159
}
62-
return Err(NoSolution);
6360
}
61+
return Err(NoSolution);
6462
}
63+
6564
// FIXME(associated_const_equality): All users of normalize_projection_ty expected
6665
// a type, but there is the possibility it could've been a const now. Maybe change
6766
// it to a Term later?

0 commit comments

Comments
 (0)