Skip to content

Commit e8f0b17

Browse files
committed
yikes
1 parent e05ab47 commit e8f0b17

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

compiler/rustc_next_trait_solver/src/solve/trait_goals.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,21 @@ where
14281428
&mut self,
14291429
goal: Goal<I, TraitPredicate<I>>,
14301430
) -> Result<(CanonicalResponse<I>, Option<TraitGoalProvenVia>), NoSolution> {
1431+
if goal
1432+
.param_env
1433+
.caller_bounds()
1434+
.iter()
1435+
.filter_map(|c| c.as_trait_clause())
1436+
.filter_map(|c| c.no_bound_vars())
1437+
.any(|p| p == goal.predicate)
1438+
{
1439+
let candidate = self
1440+
.probe_trait_candidate(CandidateSource::ParamEnv(ParamEnvSource::NonGlobal))
1441+
.enter(|ecx| ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes))
1442+
.unwrap();
1443+
return Ok((candidate.result, Some(TraitGoalProvenVia::ParamEnv)));
1444+
}
1445+
14311446
let candidates = self.assemble_and_evaluate_candidates(goal, AssembleCandidatesFrom::All);
14321447
self.merge_trait_candidates(candidates)
14331448
}

0 commit comments

Comments
 (0)