don't leak internal temporaries from dbg!, even on false unwind paths#155915
Open
dianne wants to merge 2 commits intorust-lang:mainfrom
Open
don't leak internal temporaries from dbg!, even on false unwind paths#155915dianne wants to merge 2 commits intorust-lang:mainfrom
dbg!, even on false unwind paths#155915dianne wants to merge 2 commits intorust-lang:mainfrom
Conversation
Collaborator
|
The Clippy subtree was changed cc @rust-lang/clippy |
dianne
commented
Apr 28, 2026
d0ae98f to
b896b20
Compare
Contributor
|
t-compiler will defer backport decision to t-libs since this is almost entirely in their purview |
Member
|
Maybe it's worth a crater run compared to stable? |
Contributor
Author
|
@bors try |
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
May 2, 2026
don't leak internal temporaries from `dbg!`, even on false unwind paths
Contributor
Contributor
Author
Member
|
I just meant stable vs. this nightly -- which will include other changes, but that's true if we beta-backport too. I think we can just do this: @craterbot check start=1.95.0 |
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
@craterbot check start=1.95.0 end=try#012cd62c9add58ab3910e44c137d87db3ab70f61 |
Collaborator
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hopefully fixes #155902 for real this time! See #155902 (comment) and the following comments for why I think
matching on a tuple ofdbg!'s arguments seems not to be a viable implementation strategy. Instead, this usessuper letto get better control over scoping, which unfortunately makes for pretty awkward code with the current version ofsuper let.One alternative to this would be reverting all the recent changes to
dbg!for now and re-landing them oncesuper let's replacement is usable. That will probably be the go-to answer for these tricky scoping problems.Another alternative would be to change Rust's static semantics to (hopefully) make the
match-baseddbg!not a problem.I also noticed
std::macros::dbg_internal!seems to be stable in beta (playground), so I've taken the liberty of de-stabilizing it. I can pull that out into a separate PR later if that'd be better, but I figure if we revert the recent changes todbg!, we'd also be reverting the addition ofdbg_internal!, so for now that's here.This may also need clippy and compiler review, but let's start with r? libs