File tree 2 files changed +13
-2
lines changed
compiler/rustc_next_trait_solver/src/solve
2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1301,7 +1301,6 @@ where
1301
1301
. filter ( |c| matches ! ( c. source, CandidateSource :: ParamEnv ( _) ) )
1302
1302
. map ( |c| c. result )
1303
1303
. collect ( ) ;
1304
-
1305
1304
return if let Some ( response) = self . try_merge_responses ( & where_bounds) {
1306
1305
Ok ( ( response, Some ( TraitGoalProvenVia :: ParamEnv ) ) )
1307
1306
} else {
@@ -1322,9 +1321,18 @@ where
1322
1321
} ;
1323
1322
}
1324
1323
1324
+ // If there are *only* global where bounds, then make sure to return that this
1325
+ // is still reported as being proven-via the param-env so that rigid projections
1326
+ // operate correctly.
1327
+ let proven_via =
1328
+ if candidates. iter ( ) . all ( |c| matches ! ( c. source, CandidateSource :: ParamEnv ( _) ) ) {
1329
+ TraitGoalProvenVia :: ParamEnv
1330
+ } else {
1331
+ TraitGoalProvenVia :: Misc
1332
+ } ;
1325
1333
let all_candidates: Vec < _ > = candidates. into_iter ( ) . map ( |c| c. result ) . collect ( ) ;
1326
1334
if let Some ( response) = self . try_merge_responses ( & all_candidates) {
1327
- Ok ( ( response, Some ( TraitGoalProvenVia :: Misc ) ) )
1335
+ Ok ( ( response, Some ( proven_via ) ) )
1328
1336
} else {
1329
1337
self . flounder ( & all_candidates) . map ( |r| ( r, None ) )
1330
1338
}
Original file line number Diff line number Diff line change
1
+ //@ revisions: current next
2
+ //@ ignore-compare-mode-next-solver (explicit revisions)
3
+ //@[next] compile-flags: -Znext-solver
1
4
//@ compile-flags: -Clink-dead-code=on --crate-type=lib
2
5
//@ build-pass
3
6
You can’t perform that action at this time.
0 commit comments