Dont bail in error predicate unless self ty is error in new solver#146602
Closed
compiler-errors wants to merge 1 commit intorust-lang:mainfrom
Closed
Dont bail in error predicate unless self ty is error in new solver#146602compiler-errors wants to merge 1 commit intorust-lang:mainfrom
compiler-errors wants to merge 1 commit intorust-lang:mainfrom
Conversation
Collaborator
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
Contributor
Author
|
r? lcnr |
compiler-errors
commented
Sep 15, 2025
Comment on lines
+462
to
+469
| // If either of the tupled capture types are constrained to error | ||
| // (e.g. during typeck when the infcx is tainted), then just return | ||
| // the error type directly. | ||
| if let ty::Error(_) = tupled_inputs_ty.kind() { | ||
| return tupled_inputs_ty; | ||
| } else if let ty::Error(_) = coroutine_captures_by_ref_ty.kind() { | ||
| return coroutine_captures_by_ref_ty; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This is necessary b/c we now try to project some <{async closure} as FnOnce>::Output predicate whose substs have been constrained to {type error} (namely, the tupled upvars and coroutine captures by ref tys), whereas we used to bail.
lcnr
reviewed
Sep 17, 2025
| let result = if let Err(guar) = goal.predicate.error_reported() { | ||
| G::consider_error_guaranteed_candidate(self, guar) | ||
| let result = if let ty::Error(guar) = goal.predicate.self_ty().kind() { | ||
| G::consider_error_guaranteed_candidate(self, goal, guar) |
Contributor
There was a problem hiding this comment.
I think we should move this out of assemble_builtin_impl_candidate to avoid ambiguity between e.g. blanket impls and the builtin impl candidate 🤔
Contributor
|
@compiler-errors Would you mind if I finish this? |
Contributor
Author
|
go ahead |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should improve inference w/ predicates containing error in the new solver.
cc @ChayimFriedman2 https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/How.20senstivie.20is.20the.20solver.20to.20error.20types.3F/with/539434766