-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Dont bail in error predicate unless self ty is error in new solver #146602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -459,6 +459,15 @@ impl<I: Interner> CoroutineClosureSignature<I> { | |
| coroutine_captures_by_ref_ty: I::Ty, | ||
| env_region: I::Region, | ||
| ) -> I::Ty { | ||
| // 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; | ||
| } | ||
|
Comment on lines
+462
to
+469
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is necessary b/c we now try to project some There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that's fine 🤔 👍 |
||
|
|
||
| match kind { | ||
| ty::ClosureKind::Fn | ty::ClosureKind::FnMut => { | ||
| let ty::FnPtr(sig_tys, _) = coroutine_captures_by_ref_ty.kind() else { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move this out of
assemble_builtin_impl_candidateto avoid ambiguity between e.g. blanket impls and the builtin impl candidate 🤔