Skip to content
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

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

chenyukang
Copy link
Member

Fixes #118596

@rustbot
Copy link
Collaborator

rustbot commented Jan 6, 2024

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
Contributor

r? compiler
I'm overloaded with reviews.

@rustbot rustbot assigned wesleywiser and unassigned petrochenkov Jan 6, 2024
compiler/rustc_middle/src/mir/mod.rs Outdated Show resolved Hide resolved
matches!(
self.local_info(),
LocalInfo::User(BindingForm::Var(VarBindingForm {
binding_mode: ty::BindingMode::BindByValue(Mutability::Not),
Copy link
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
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
Copy link
Contributor

bors commented Feb 9, 2024

☔ 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
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
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
Copy link
Member

fmease commented Apr 24, 2024

Oh no, bors never caught the r+ :(

@bors r=wesleywiser

@bors
Copy link
Contributor

bors commented Apr 24, 2024

📌 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
Copy link
Member

fmease commented Apr 24, 2024

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
Copy link
Contributor

bors commented Apr 24, 2024

⌛ 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
Copy link
Contributor

bors commented Apr 24, 2024

💔 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
Copy link
Member

fmease commented Apr 24, 2024

@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
Member

@bors r-

@chenyukang
Copy link
Member Author

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

rebased and resolved tidy issues.

@fmease
Copy link
Member

fmease commented Apr 25, 2024

@bors r=wesleywiser rollup

@bors
Copy link
Contributor

bors commented Apr 25, 2024

📌 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
Copy link
Contributor

bors commented Apr 25, 2024

⌛ Testing commit be9dbe9 with merge 31e6e8c...

@bors
Copy link
Contributor

bors commented Apr 25, 2024

☀️ 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
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 25, 2024
@rust-timer
Copy link
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