Skip to content

Commit fb5a579

Browse files
Don't Create ParamCandidate When Obligation Contains Errors
Fixes rust-lang#121941
1 parent d713174 commit fb5a579

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
219219
) -> Result<(), SelectionError<'tcx>> {
220220
debug!(?stack.obligation);
221221

222+
if stack.obligation.predicate.references_error() {
223+
return Ok(());
224+
}
225+
222226
let all_bounds = stack
223227
.obligation
224228
.param_env

0 commit comments

Comments
 (0)