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

Warn for variables that are no longer captured #90597

Merged
merged 4 commits into from
Nov 6, 2021

Conversation

nikomatsakis
Copy link
Contributor

r? @wesleywiser

cc @rust-lang/wg-rfc-2229

Fixes #90465

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 5, 2021
@nikomatsakis nikomatsakis added beta-nominated Nominated for backporting to the compiler in the beta channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Nov 5, 2021
@nikomatsakis
Copy link
Contributor Author

Nominating for backport: this bug fixes incorrect migration that can cause subtle changes in execution order (see #90465)

Copy link
Member

@arora-aman arora-aman left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this. I only have nits.

compiler/rustc_typeck/src/check/upvar.rs Show resolved Hide resolved
compiler/rustc_typeck/src/check/upvar.rs Outdated Show resolved Hide resolved
compiler/rustc_typeck/src/check/upvar.rs Show resolved Hide resolved
compiler/rustc_typeck/src/check/upvar.rs Outdated Show resolved Hide resolved
Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

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

One small suggestion, feel free to take it or leave it 🙂

r=me with CapturesInfo renamed per @arora-aman's suggestion

compiler/rustc_typeck/src/check/upvar.rs Outdated Show resolved Hide resolved
@nikomatsakis
Copy link
Contributor Author

@bors r=wesleywiser

@bors
Copy link
Contributor

bors commented Nov 5, 2021

📌 Commit 4154e8a has been approved by wesleywiser

@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 Nov 5, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 5, 2021
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#89942 (Reorder `widening_impl`s to make the doc clearer)
 - rust-lang#90569 (Fix tests using `only-i686` to use the correct `only-x86` directive)
 - rust-lang#90597 (Warn for variables that are no longer captured)
 - rust-lang#90623 (Remove more checks for LLVM < 12)
 - rust-lang#90626 (Properly register text_direction_codepoint_in_comment lint.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4b1cb73 into rust-lang:master Nov 6, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 6, 2021
@apiraino apiraino added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Nov 11, 2021
@apiraino
Copy link
Contributor

apiraino commented Nov 11, 2021

Beta backport approved as per compiler team on Zulip

stable backport declined

@rustbot label +beta-accepted
@rustbot label -stable-nominated

@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2021

Error: Label beta-accepted can only be set by Rust team members;we were unable to check if you are a team member.

Please let @rust-lang/release know if you're having trouble with this bot.

@rustbot rustbot removed the stable-nominated Nominated for backporting to the compiler in the stable channel. label Nov 11, 2021
@apiraino apiraino added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Nov 11, 2021
@cuviper cuviper mentioned this pull request Nov 16, 2021
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Nov 16, 2021
@cuviper cuviper modified the milestones: 1.58.0, 1.57.0 Nov 16, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 19, 2021
[beta] backports

-  Fix assertion failures in OwnedHandle with windows_subsystem. rust-lang#88798
-  Ensure that pushing empty path works as before on verbatim paths rust-lang#89665
-  Feature gate + make must_not_suspend allow-by-default rust-lang#89826
-  Only use clone3 when needed for pidfd rust-lang#89930
-  Fix documentation header sizes rust-lang#90186
-  Fixes incorrect handling of ADT's drop requirements rust-lang#90218
-  Fix ICE when forgetting to Box a parameter to a Self::func call rust-lang#90221
-  Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated rust-lang#90266
-  Update odht crate to 0.3.1 (big-endian bugfix) rust-lang#90403
-  rustdoc: Go back to loading all external crates unconditionally rust-lang#90489
-  Split doc_cfg and doc_auto_cfg features rust-lang#90502
-  Apply adjustments for field expression even if inaccessible rust-lang#90508
-  Warn for variables that are no longer captured rust-lang#90597
-  Properly register text_direction_codepoint_in_comment lint. rust-lang#90626
-  CI: Use ubuntu image to download openssl, curl sources, cacert.pem for x86 dist builds rust-lang#90457
-  Android is not GNU rust-lang#90834
-  Update llvm submodule rust-lang#90954

Additionally, this bumps the stage 0 compiler from beta to stable 1.56.1.

r? `@Mark-Simulacrum`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing warning for migration of let _ = x between Rust 2018 and 2021 edition
9 participants