Skip to content

Conversation

cjgillot
Copy link
Contributor

In an effort to make bugs like #146383 more easily discovered, this PR extends the "overlapping assignment" MIR lint.

I had to whitelist some rvalues, as they are actually allowed to alias, like a = a + 1.

@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2025

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Sep 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2025

r? @saethlin

rustbot has assigned @saethlin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@saethlin
Copy link
Member

@bors r+ rollup

-Zlint-mir is off by default so this shouldn't be capable of causing perf impacts.

@bors
Copy link
Collaborator

bors commented Sep 17, 2025

📌 Commit acf0615 has been approved by saethlin

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 Sep 17, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Sep 17, 2025
Lint more overlapping assignments in MIR.

In an effort to make bugs like rust-lang#146383 more easily discovered, this PR extends the "overlapping assignment" MIR lint.

I had to whitelist some rvalues, as they are actually allowed to alias, like `a = a + 1`.
@Zalathar
Copy link
Contributor

This has a soft conflict with #146564, so I'm going to temporarily remove this PR from the queue to help the more-bitrotty PR land first.

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 17, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 17, 2025

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member

I think this is in the clear now?

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 18, 2025

📌 Commit 912785d has been approved by saethlin

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 Sep 18, 2025
bors added a commit that referenced this pull request Sep 18, 2025
Rollup of 5 pull requests

Successful merges:

 - #146566 (Lint more overlapping assignments in MIR.)
 - #146645 (Cleanup `FnDecl::inner_full_print`)
 - #146664 (Clean up `ty::Dynamic`)
 - #146673 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 4))
 - #146694 (Remove ImplSubject)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d5aa8d5 into rust-lang:master Sep 18, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 18, 2025
rust-timer added a commit that referenced this pull request Sep 18, 2025
Rollup merge of #146566 - cjgillot:mir-overlap-lint, r=saethlin

Lint more overlapping assignments in MIR.

In an effort to make bugs like #146383 more easily discovered, this PR extends the "overlapping assignment" MIR lint.

I had to whitelist some rvalues, as they are actually allowed to alias, like `a = a + 1`.
@cjgillot cjgillot deleted the mir-overlap-lint branch September 18, 2025 10:36
@Kobzol
Copy link
Member

Kobzol commented Sep 23, 2025

@rust-timer build a7976cf

Perf. run for #146698.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a7976cf): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 4.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.8% [4.4%, 5.3%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.5% [3.4%, 3.6%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.1% [-4.3%, -2.2%] 3
All ❌✅ (primary) - - 0

Binary size

Results (secondary -0.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 471.663s -> 470.424s (-0.26%)
Artifact size: 387.94 MiB -> 388.21 MiB (0.07%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

8 participants