-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[DO NOT MERGE] Forbid closures that outlive their signature #60332
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[DO NOT MERGE] Forbid closures that outlive their signature #60332
Conversation
* This prevents the AST borrow checker from incorrectly accepting closures that return references to local variables and that are never called. * This also ensures that existential types don't end up containing any `ReScope`s
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @ghost |
@bors try |
[DO NOT MERGE] Forbid closures that outlive their signature * This prevents the AST borrow checker from incorrectly accepting closures that return references to local variables and that are never called. Note: NLL already fixes this. * This also ensures that existential types don't end up containing any `ReScope`s. This is the principled solution to #57464. Opening this for a crater run to see how much code this affects. The second issue occurs twice in this repo: * `src/librustc_metadata/decoder.rs` * `src/test/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs`
☀️ Try build successful - checks-travis |
@craterbot run start=master#d4a32d504a5aa49b951bfc70602a9615cb772acf end=try#6f91e1b1f1477b82616e3cd142d5d528acf8518c mode=check-only |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
Ok, looks like this isn't a viable change. |
closures that return references to local variables and that are never
called. Note: NLL already fixes this.
any
ReScope
s. This is the principled solution to Nightly rustc crashes with "unexpected region in query response" #57464.Opening this for a crater run to see how much code this affects.
The second issue occurs twice in this repo:
src/librustc_metadata/decoder.rs
src/test/run-pass/regions/regions-relate-bound-regions-on-closures-to-inference-variables.rs