-
Notifications
You must be signed in to change notification settings - Fork 13.7k
fix drop scope for super let
bindings within if let
#145342
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
They now use the enclosing temporary scope as their scope, regardless of which `ScopeData` was used to mark it.
f7b3d29
to
8fc3938
Compare
@dianne does this need crater?
@bors2 try
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
fix drop scope for `super let` bindings within `if let`
@craterbot check
👌 Experiment pr-145342
created and queued.
🤖 Automatically detected try build a498031
🔍 You can check out the queue and this experiment's details.
i️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
How does #145374 relate to this? The code there doesn't use super let
anywhere.
Format arguments, e.g. as used by write!
, are also implemented in terms of super let
. This is visible when printing the HIR of that test case:
f.write_fmt({
super let args =
(&pointee.behind_pointer(),
&ItemIdentifier::path(&ItemIdentifier::nserror()));
super let args =
[format_argument::new_display(args.0),
format_argument::new_display(args.1)];
format_arguments::new_v1(&["", ", "], &args)
})
The interaction between that, old editions not treating block tail expressions as temporary drop scopes, my guard scoping PR, and the existing super let
scoping bug is what caused that particular regression.
🎉 Experiment pr-145342-1
is completed!
📊 0 regressed and 0 fixed (178704 total)
📊 39455 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.
i️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more
Footnotes
-
re-run the experiment with
crates={retry_regressed_list_url}
↩
r? rust-lang/compiler
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
r? rust-lang/compiler
@bors r+
...cote fix drop scope for `super let` bindings within `if let` Fixes rust-lang#145328 by making non-lifetime-extended `super let` reuse the logic used to compute drop scopes for non-lifetime-extended temporaries. Also fixes rust-lang#145374, which regressed due to rust-lang#143376 introducing `if let`-like scopes for match arms with guards. Tracking issue for `super let`: rust-lang#139076 This is a regression fix / breaking change for macros stably exposing `super let`, including `pin!` and `format_args!`. Nominating to be discussed alongside rust-lang#145328: `@rustbot` label +I-lang-nominated +I-libs-api-nominated
Rollup of 16 pull requests Successful merges: - #143725 (core: add Peekable::next_if_map) - #145209 (Stabilize `path_add_extension`) - #145342 (fix drop scope for `super let` bindings within `if let`) - #145750 (raw_vec.rs: Remove superfluous fn alloc_guard) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #145963 (Add LSX accelerated implementation for source file analysis) - #146054 (add `#[must_use]` to `array::repeat`) - #146090 (Derive `PartialEq` for `InvisibleOrigin`) - #146120 (Correct typo in `rustc_errors` comment) - #146127 (Rename `ToolRustc` to `ToolRustcPrivate`) - #146133 (Revert "Make `lto` and `linker-plugin-lto` work the same for `compiler_builtins`) - #146134 (llvm: nvptx: Layout update to match LLVM) - #146136 (docs(std): add missing closing code block fences in doc comments) - #146137 (Disallow frontmatter in `--cfg` and `--check-cfg` arguments) - #146140 (compiletest: cygwin follows windows in using PATH for dynamic libraries) - #146156 (miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
...cote fix drop scope for `super let` bindings within `if let` Fixes rust-lang#145328 by making non-lifetime-extended `super let` reuse the logic used to compute drop scopes for non-lifetime-extended temporaries. Also fixes rust-lang#145374, which regressed due to rust-lang#143376 introducing `if let`-like scopes for match arms with guards. Tracking issue for `super let`: rust-lang#139076 This is a regression fix / breaking change for macros stably exposing `super let`, including `pin!` and `format_args!`. Nominating to be discussed alongside rust-lang#145328: ``@rustbot`` label +I-lang-nominated +I-libs-api-nominated
Rollup of 24 pull requests Successful merges: - #140459 (Add `read_buf` equivalents for positioned reads) - #143725 (core: add Peekable::next_if_map) - #145209 (Stabilize `path_add_extension`) - #145342 (fix drop scope for `super let` bindings within `if let`) - #145750 (raw_vec.rs: Remove superfluous fn alloc_guard) - #145827 (On unused binding or binding not present in all patterns, suggest potential typo of unit struct/variant or const) - #145932 (Allow `inline(always)` with a target feature behind a unstable feature `target_feature_inline_always`.) - #145962 (Ensure we emit an allocator shim when only some crate types need one) - #145963 (Add LSX accelerated implementation for source file analysis) - #146054 (add `#[must_use]` to `array::repeat`) - #146090 (Derive `PartialEq` for `InvisibleOrigin`) - #146112 (don't uppercase error messages) - #146120 (Correct typo in `rustc_errors` comment) - #146124 (Test `rustc-dev` in `distcheck`) - #146127 (Rename `ToolRustc` to `ToolRustcPrivate`) - #146131 (rustdoc-search: add test case for indexing every item type) - #146134 (llvm: nvptx: Layout update to match LLVM) - #146136 (docs(std): add missing closing code block fences in doc comments) - #146137 (Disallow frontmatter in `--cfg` and `--check-cfg` arguments) - #146140 (compiletest: cygwin follows windows in using PATH for dynamic libraries) - #146150 (fix(rustdoc): match rustc `--emit` precedence ) - #146155 (Make bootstrap self test parallel) - #146161 ([rustdoc] Uncomment code to add scraped rustdoc examples in loaded paths) - #146172 (triagebot: configure some pings when certain attributes are used) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #145342 - dianne:if-let-super-let, r=nnethercote fix drop scope for `super let` bindings within `if let` Fixes #145328 by making non-lifetime-extended `super let` reuse the logic used to compute drop scopes for non-lifetime-extended temporaries. Also fixes #145374, which regressed due to #143376 introducing `if let`-like scopes for match arms with guards. Tracking issue for `super let`: #139076 This is a regression fix / breaking change for macros stably exposing `super let`, including `pin!` and `format_args!`. Nominating to be discussed alongside #145328: ```@rustbot``` label +I-lang-nominated +I-libs-api-nominated
Uh oh!
There was an error while loading. Please reload this page.
Fixes #145328 by making non-lifetime-extended
super let
reuse the logic used to compute drop scopes for non-lifetime-extended temporaries.Also fixes #145374, which regressed due to #143376 introducing
if let
-like scopes for match arms with guards.Tracking issue for
super let
: #139076This is a regression fix / breaking change for macros stably exposing
super let
, includingpin!
andformat_args!
.Nominating to be discussed alongside #145328: @rustbot label +I-lang-nominated +I-libs-api-nominated