-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Remove PredicateKind::ClosureKind
#118120
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
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 |
---|---|---|
|
@@ -291,8 +291,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { | |
} | ||
} | ||
None => { | ||
debug!("assemble_unboxed_candidates: closure_kind not yet known"); | ||
candidates.vec.push(ClosureCandidate { is_const }); | ||
if kind == ty::ClosureKind::FnOnce { | ||
candidates.vec.push(ClosureCandidate { is_const }); | ||
} else { | ||
candidates.ambiguous = true; | ||
} | ||
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 slightly weakens inference, does it? we now stall 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. No, since we always make progress on a corresponding FnOnce projection that gets emitted besides it, which will always make sure we constrain the signature. I don't immediately see a case where stalling an FnMut or Fn trait goal itself will cause inference to be affected negatively, as long as we can make progress on the projection goal and make inference progress on the closure's signature. 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. ah, that's because the only stable usage of the 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. Yes, specifically an 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 could result in inference changes if you use the unboxed_closure syntax + raw fn_traits + custom |
||
} | ||
} | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.