Skip to content

Suggest ref mut for pattern matching assignment#119650

Merged
bors merged 1 commit into
rust-lang:masterfrom
chenyukang:yukang-fix-118596-ref-mut
Apr 25, 2024
Merged

Suggest ref mut for pattern matching assignment#119650
bors merged 1 commit into
rust-lang:masterfrom
chenyukang:yukang-fix-118596-ref-mut

Conversation

@chenyukang

Copy link
Copy Markdown
Member

Fixes #118596

@rustbot

rustbot commented Jan 6, 2024

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 6, 2024
@petrochenkov

Copy link
Copy Markdown
Contributor

r? compiler
I'm overloaded with reviews.

@rustbot rustbot assigned wesleywiser and unassigned petrochenkov Jan 6, 2024
Comment thread compiler/rustc_middle/src/mir/mod.rs Outdated
Comment thread compiler/rustc_middle/src/mir/mod.rs Outdated
matches!(
self.local_info(),
LocalInfo::User(BindingForm::Var(VarBindingForm {
binding_mode: ty::BindingMode::BindByValue(Mutability::Not),

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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.

@bors

bors commented Feb 9, 2024

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #120843) made this pull request unmergeable. Please resolve the merge conflicts.

@chenyukang chenyukang force-pushed the yukang-fix-118596-ref-mut branch 3 times, most recently from 7a9b4fb to 5b26c10 Compare February 11, 2024 02:31
@chenyukang

Copy link
Copy Markdown
Member Author

@rustbot ready

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2024
… 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.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 12, 2024
… 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.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 12, 2024
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.
@wesleywiser

Copy link
Copy Markdown
Member

Thanks @chenyukang!

@bors r+

lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
…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.
@fmease

fmease commented Apr 24, 2024

Copy link
Copy Markdown
Member

Oh no, bors never caught the r+ :(

@bors r=wesleywiser

@bors

bors commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit 5b26c10 has been approved by wesleywiser

It is now in the queue for this repository.

@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 Apr 24, 2024
@fmease

fmease commented Apr 24, 2024

Copy link
Copy Markdown
Member

More than a month has passed, this might no longer build and might require a rebase. Therefore:

@bors rollup=iffy

@fmease

This comment was marked as resolved.

@bors

bors commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 5b26c10 with merge 8e84124...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
…, r=wesleywiser

Suggest ref mut for pattern matching assignment

Fixes rust-lang#118596
@rust-log-analyzer

This comment has been minimized.

@bors

bors commented Apr 24, 2024

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 24, 2024
@fmease

fmease commented Apr 24, 2024

Copy link
Copy Markdown
Member

@chenyukang Could you rebase and fix CI? Thanks!
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 24, 2024
@matthiaskrgr

Copy link
Copy Markdown
Member

@bors r-

@chenyukang chenyukang force-pushed the yukang-fix-118596-ref-mut branch from 5b26c10 to be9dbe9 Compare April 24, 2024 20:56
@chenyukang

Copy link
Copy Markdown
Member Author

@chenyukang Could you rebase and fix CI? Thanks! @rustbot author

rebased and resolved tidy issues.

@fmease

fmease commented Apr 25, 2024

Copy link
Copy Markdown
Member

@bors r=wesleywiser rollup

@bors

bors commented Apr 25, 2024

Copy link
Copy Markdown
Collaborator

📌 Commit be9dbe9 has been approved by wesleywiser

It is now in the queue for this repository.

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 25, 2024
@bors

bors commented Apr 25, 2024

Copy link
Copy Markdown
Collaborator

⌛ Testing commit be9dbe9 with merge 31e6e8c...

@bors

bors commented Apr 25, 2024

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing 31e6e8c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 25, 2024
@bors bors merged commit 31e6e8c into rust-lang:master Apr 25, 2024
@rustbot rustbot added this to the 1.79.0 milestone Apr 25, 2024
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (31e6e8c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This 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.

Cycles

Results

This 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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.6% [1.1%, 2.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 670.011s -> 673.3s (0.49%)
Artifact size: 315.97 MiB -> 315.96 MiB (-0.00%)

RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

Suggestion to make a binding mutable could lead beginners astray

9 participants