@@ -25,10 +25,10 @@ fn normalize_projection_ty<'tcx>(
25
25
goal : CanonicalProjectionGoal < ' tcx > ,
26
26
) -> Result < & ' tcx Canonical < ' tcx , QueryResponse < ' tcx , NormalizationResult < ' tcx > > > , NoSolution > {
27
27
debug ! ( "normalize_provider(goal={:#?})" , goal) ;
28
-
29
28
tcx. infer_ctxt ( ) . enter_canonical_trait_query (
30
29
& goal,
31
30
|ocx, ParamEnvAnd { param_env, value : goal } | {
31
+ debug_assert ! ( !ocx. infcx. next_trait_solver( ) ) ;
32
32
let selcx = & mut SelectionContext :: new ( ocx. infcx ) ;
33
33
let cause = ObligationCause :: dummy ( ) ;
34
34
let mut obligations = vec ! [ ] ;
@@ -45,23 +45,22 @@ fn normalize_projection_ty<'tcx>(
45
45
// are recursive (given some substitution of the opaque's type variables).
46
46
// In that case, we may only realize a cycle error when calling
47
47
// `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) ;
60
58
}
61
59
}
62
- return Err ( NoSolution ) ;
63
60
}
61
+ return Err ( NoSolution ) ;
64
62
}
63
+
65
64
// FIXME(associated_const_equality): All users of normalize_projection_ty expected
66
65
// a type, but there is the possibility it could've been a const now. Maybe change
67
66
// it to a Term later?
0 commit comments