@@ -947,32 +947,32 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
947
947
948
948
let tcx = selcx. infcx ( ) . tcx ;
949
949
950
- result . obligations . drain_filter ( |projected_obligation| {
951
- // If any global obligations always apply, considering regions, then we don't
952
- // need to include them. The `is_global` check rules out inference variables,
953
- // so there's no need for the caller of `opt_normalize_projection_type`
954
- // to evaluate them.
955
- // Note that we do *not* discard obligations that evaluate to
956
- // `EvaluatedtoOkModuloRegions`. Evaluating these obligations
957
- // inside of a query (e.g. `evaluate_obligation`) can change
958
- // the result to `EvaluatedToOkModuloRegions`, while an
959
- // `EvaluatedToOk` obligation will never change the result.
960
- // See #85360 for more details
961
- if !projected_obligation . is_global ( tcx ) {
962
- return false ;
963
- }
964
-
965
- // We create a fresh `InferCtxt` for each predicate we speculatively evaluate,
966
- // so that we won't create (and cache) any spurious projection cycles in the main
967
- // `InferCtxt`
968
- tcx . infer_ctxt ( ) . enter ( |infcx| {
969
- let mut canonical =
970
- SelectionContext :: with_query_mode ( & infcx , TraitQueryMode :: Canonical ) ;
950
+ // We create a fresh `InferCtxt` for speculative evaluation
951
+ // so that we won't create (and cache) any spurious projection cycles in the main
952
+ // `InferCtxt`
953
+ tcx . infer_ctxt ( ) . enter ( |infcx| {
954
+ let mut canonical =
955
+ SelectionContext :: with_query_mode ( & infcx , TraitQueryMode :: Canonical ) ;
956
+
957
+ result . obligations . drain_filter ( |projected_obligation| {
958
+ // If any global obligations always apply, considering regions, then we don't
959
+ // need to include them. The `is_global` check rules out inference variables,
960
+ // so there's no need for the caller of `opt_normalize_projection_type`
961
+ // to evaluate them.
962
+ // Note that we do *not* discard obligations that evaluate to
963
+ // `EvaluatedtoOkModuloRegions`. Evaluating these obligations
964
+ // inside of a query (e.g. `evaluate_obligation`) can change
965
+ // the result to `EvaluatedToOkModuloRegions`, while an
966
+ // `EvaluatedToOk` obligation will never change the result.
967
+ // See #85360 for more details
968
+ if !projected_obligation . is_global ( tcx ) {
969
+ return false ;
970
+ }
971
971
972
972
canonical
973
973
. evaluate_root_obligation ( projected_obligation)
974
974
. map_or ( false , |res| res. must_apply_considering_regions ( ) )
975
- } )
975
+ } ) ;
976
976
} ) ;
977
977
978
978
if use_cache {
0 commit comments