Skip to content

Conversation

@compiler-errors
Copy link
Contributor

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@compiler-errors
Copy link
Contributor Author

r? lcnr

@rustbot rustbot assigned lcnr and unassigned nnethercote 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;
}
Copy link
Contributor Author

@compiler-errors compiler-errors Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's fine 🤔 👍

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)
Copy link
Contributor

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_candidate to avoid ambiguity between e.g. blanket impls and the builtin impl candidate 🤔

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lcnr lcnr added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 17, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 27, 2025
@ChayimFriedman2
Copy link
Contributor

@compiler-errors Would you mind if I finish this?

@compiler-errors
Copy link
Contributor Author

go ahead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants