-
Notifications
You must be signed in to change notification settings - Fork 13.3k
use closure def-id in returns, but base def-id in locals #54599
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
Conversation
Using the `closure_base_def_id` indiscriminantely, as we were doing before, winds up "going wrong" if the closure type includes the `impl Trait` from the parent. The problem arises because the return value for closures is inferred and meant to treat the return type *opaquely*, so we don't want to be "desugaring" it into the underlying type.
d32778b
to
bcfdfe4
Compare
@bors r+ |
📌 Commit bcfdfe4 has been approved by |
⌛ Testing commit bcfdfe4 with merge 4ef6e9410d8920c12e31e5337962076b77722d66... |
💔 Test failed - status-travis |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors: retry |
use closure def-id in returns, but base def-id in locals The refactorings to handle `let x: impl Trait` wound up breaking `impl Trait` in closure return types. I think there are some deeper problems with the code in question, but this a least should make @eddyb's example work. Fixes #54593 r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
The refactorings to handle
let x: impl Trait
wound up breakingimpl Trait
in closure return types. I think there are some deeper problems with the code in question, but this a least should make @eddyb's example work.Fixes #54593
r? @eddyb