-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Suggest ref mut for pattern matching assignment #119650
Conversation
(rustbot has picked a reviewer for you, use r? to override) |
r? compiler |
compiler/rustc_middle/src/mir/mod.rs
Outdated
matches!( | ||
self.local_info(), | ||
LocalInfo::User(BindingForm::Var(VarBindingForm { | ||
binding_mode: ty::BindingMode::BindByValue(Mutability::Not), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems more restrictive than the method name would imply. Can we check the mutability in the caller instead to make this more generic like the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it's not a general api.
I found the caller already has decl.can_be_made_mutable()
to make it safe to add mut
, so we don't need to check it.
☔ The latest upstream changes (presumably #120843) made this pull request unmergeable. Please resolve the merge conflicts. |
7a9b4fb
to
5b26c10
Compare
@rustbot ready |
… r=compiler-errors Remove a bunch of dead parameters in functions Found this kind of issue when working on rust-lang#119650 I wrote a trivial toy lint and manual review to find these.
… r=compiler-errors Remove a bunch of dead parameters in functions Found this kind of issue when working on rust-lang#119650 I wrote a trivial toy lint and manual review to find these.
Rollup merge of rust-lang#120917 - chenyukang:yukang-dead-parameters, r=compiler-errors Remove a bunch of dead parameters in functions Found this kind of issue when working on rust-lang#119650 I wrote a trivial toy lint and manual review to find these.
Thanks @chenyukang! @bors r+ |
…er-errors Remove a bunch of dead parameters in functions Found this kind of issue when working on rust-lang/rust#119650 I wrote a trivial toy lint and manual review to find these.
Oh no, bors never caught the r+ :( @bors r=wesleywiser |
More than a month has passed, this might no longer build and might require a rebase. Therefore: @bors rollup=iffy |
This comment was marked as resolved.
This comment was marked as resolved.
…, r=wesleywiser Suggest ref mut for pattern matching assignment Fixes rust-lang#118596
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@chenyukang Could you rebase and fix CI? Thanks! |
@bors r- |
5b26c10
to
be9dbe9
Compare
rebased and resolved tidy issues. |
@bors r=wesleywiser rollup |
☀️ Test successful - checks-actions |
Finished benchmarking commit (31e6e8c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 670.011s -> 673.3s (0.49%) |
…er-errors Remove a bunch of dead parameters in functions Found this kind of issue when working on rust-lang/rust#119650 I wrote a trivial toy lint and manual review to find these.
Fixes #118596