Skip to content
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

borrowck=migrate must look at parents of closures #55494

Conversation

pnkfelix
Copy link
Member

This fixes the NLL migration mode (which is the default with edition=2018) to inspect all parents of a closure in addition to the closure itself when looking to see if AST-borrowck issues an error for the given code.

This should be a candidate for beta backport.

Fix #55492

@rust-highfive
Copy link
Collaborator

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 29, 2018
@pnkfelix
Copy link
Member Author

r? @davidtwco

@rust-highfive rust-highfive assigned davidtwco and unassigned eddyb Oct 29, 2018
@pnkfelix pnkfelix added A-NLL Area: Non-lexical lifetimes (NLL) NLL-sound Working towards the "invalid code does not compile" goal beta-nominated Nominated for backporting to the compiler in the beta channel. labels Oct 29, 2018
@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 30, 2018

📌 Commit 87ce5ec has been approved by davidtwco

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 30, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Oct 30, 2018
…te-must-look-at-parents-of-closures, r=davidtwco

borrowck=migrate must look at parents of closures

This fixes the NLL migration mode (which is the default with edition=2018) to inspect all parents of a closure in addition to the closure itself when looking to see if AST-borrowck issues an error for the given code.

This should be a candidate for beta backport.

Fix rust-lang#55492
bors added a commit that referenced this pull request Oct 30, 2018
Rollup of 12 pull requests

Successful merges:

 - #54885 (Don't lint 'unused_parens` on `if (break _) { .. }`)
 - #55205 (Improve a few cases of collecting to an FxHash(Map/Set))
 - #55450 (msp430: remove the whole Atomic* API)
 - #55459 (Add UI test for #49296)
 - #55472 (Use opt.take() instead of mem::replace(opt, None))
 - #55473 (Take advantage of impl Iterator in (transitive/elaborate)_bounds)
 - #55474 (Fix validation false positive)
 - #55476 (Change a flat_map with 0/1-element vecs to a filter_map)
 - #55487 (Adjust Ids of path segments in visibility modifiers)
 - #55493 (Doc fixes)
 - #55494 (borrowck=migrate must look at parents of closures)
 - #55496 (Update clippy)

Failed merges:

r? @ghost
@Mark-Simulacrum
Copy link
Member

@bors p=3

@Mark-Simulacrum Mark-Simulacrum added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Oct 30, 2018
@bors
Copy link
Contributor

bors commented Oct 30, 2018

⌛ Testing commit 87ce5ec with merge e8aef7c...

@bors bors merged commit 87ce5ec into rust-lang:master Oct 30, 2018
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 31, 2018
bors added a commit that referenced this pull request Nov 1, 2018
[beta] Rollup backports

Merged and approved:

* #55494: borrowck=migrate must look at parents of closures
* #55343: rustbuild: fix remap-debuginfo when building a release
* #55412: Fix an ICE in the min_const_fn analysis

Rolled up PRs:

* #55550: [beta] Update the boostrap compiler

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-NLL Area: Non-lexical lifetimes (NLL) beta-accepted Accepted for backporting to the compiler in the beta channel. NLL-sound Working towards the "invalid code does not compile" goal S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NLL: migration mistakenly downgrades when AST error is spread across closure and its parent
7 participants