Skip to content

Label overwritten for never read assignments#154456

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-154434-unused-assignments
Apr 1, 2026
Merged

Label overwritten for never read assignments#154456
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-154434-unused-assignments

Conversation

@chenyukang

@chenyukang chenyukang commented Mar 27, 2026

Copy link
Copy Markdown
Member

@rustbot

rustbot commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

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 Mar 27, 2026
@rustbot

rustbot commented Mar 27, 2026

Copy link
Copy Markdown
Collaborator

r? @TaKO8Ki

rustbot has assigned @TaKO8Ki.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 69 candidates
  • Random selection from 11 candidates

@chenyukang

Copy link
Copy Markdown
Member Author

Let's check whether performance changed,
@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 27, 2026
…ts, r=<try>

Label overwritten assignments for never read assignments
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 27, 2026
@chenyukang chenyukang changed the title Label overwritten assignments for never read assignments Label overwritten for never read assignments Mar 27, 2026
@rust-bors

rust-bors Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: eaf85f7 (eaf85f785b04901bc9054e3885e9d0a5570a9a05, parent: ac40f5e105ddc8144904679cb63c8879708a9a26)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (eaf85f7): comparison URL.

Overall result: no relevant changes - 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

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

Max RSS (memory usage)

Results (primary 3.6%, secondary 1.7%)

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

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

Cycles

Results (primary 3.0%, secondary 2.6%)

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

mean range count
Regressions ❌
(primary)
3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary)
2.6% [2.4%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Binary size

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

Bootstrap: 484.633s -> 485.683s (0.22%)
Artifact size: 397.11 MiB -> 397.14 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 27, 2026
= help: maybe it is overwritten before being read?
| ^ this value is reassigned later and never used
LL | b += 1;
| ------ `b` is overwritten here before the previous value is read

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.

label on this seems weird, it's a separate issue(#154457), I will work on it with following up PR.

@chenyukang

Copy link
Copy Markdown
Member Author

Finished benchmarking commit (eaf85f7): comparison URL.

Overall result: no relevant changes - 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

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

Max RSS (memory usage)

Results (primary 3.6%, secondary 1.7%)
A less reliable metric. May be of interest, but not used to determine the overall result above.

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

Cycles

Results (primary 3.0%, secondary 2.6%)
A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary) 3.0% [3.0%, 3.0%] 1
Regressions ❌
(secondary) 2.6% [2.4%, 2.9%] 2
Improvements ✅
(primary) - - 0
Improvements ✅
(secondary) - - 0
All ❌✅ (primary) 3.0% [3.0%, 3.0%] 1

Binary size

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

Bootstrap: 484.633s -> 485.683s (0.22%) Artifact size: 397.11 MiB -> 397.14 MiB (0.01%)

performance seems trivial enough.

@rustbot

This comment has been minimized.

Comment on lines +1 to +9
warning: value assigned to `d` is never read
--> $DIR/overwritten-before-read-note-issue-154434.rs:5:17
|
LL | let mut d = String::from("hello");
| ^^^^^^^^^^^^^^^^^^^^^ this value is reassigned later and never used
LL | d = String::from("ahoy");
| - `d` is overwritten here before the previous value is read
|
= note: requested on the command line with `-W unused-assignments`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the additional test given the existing ones?

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.

yes, seems it's unnecessary, I will remove it in follow-up PR.

@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@rust-bors

rust-bors Bot commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 5e0ff58 has been approved by estebank

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Mar 30, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors p=6
Scheduling this first while we figure out the rollup situation

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 31, 2026
…ts, r=estebank

Label overwritten for never read assignments

Fixes #154434
Closes #144079
@rust-log-analyzer

This comment has been minimized.

@chenyukang

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-gnu-llvm-21-3

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 31, 2026
…ts, r=<try>

Label overwritten for never read assignments


try-job: x86_64-gnu-llvm-21-3
@rust-bors

rust-bors Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 4e89344 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-154434-unused-assignments branch from 087e26f to 413f0f0 Compare March 31, 2026 13:35
@chenyukang

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-gnu-llvm-21-3

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 31, 2026
…ts, r=<try>

Label overwritten for never read assignments


try-job: x86_64-gnu-llvm-21-3
@rust-bors

rust-bors Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 05b552e failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@chenyukang chenyukang force-pushed the yukang-fix-154434-unused-assignments branch from 413f0f0 to ebf22f8 Compare March 31, 2026 14:20
@chenyukang

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-gnu-llvm-21-3

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Mar 31, 2026
…ts, r=<try>

Label overwritten for never read assignments


try-job: x86_64-gnu-llvm-21-3
@rust-bors

rust-bors Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f9599e6 (f9599e611f775cab61e208bbcdd9a36c57ca8b66, parent: e4fdb554ad2c0270473181438e338c42b5b30b0c)

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

@bors r=estebank p=0

@rust-bors

rust-bors Bot commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

📌 Commit ebf22f8 has been approved by estebank

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Mar 31, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 1, 2026
@rust-bors

rust-bors Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: estebank
Duration: 3h 8m 55s
Pushing 12ab1cf to main...

@rust-bors rust-bors Bot merged commit 12ab1cf into rust-lang:main Apr 1, 2026
13 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Apr 1, 2026
@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 700cfa8 (parent) -> 12ab1cf (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 12ab1cf1fd3dc925a846b0eb8a4b39393140fdd3 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-various: 1h 40m -> 2h 8m (+27.6%)
  2. optional-x86_64-gnu-parallel-frontend: 2h 12m -> 2h 40m (+21.0%)
  3. pr-check-1: 26m 47s -> 31m 58s (+19.4%)
  4. i686-gnu-1: 1h 56m -> 2h 17m (+18.4%)
  5. dist-apple-various: 1h 53m -> 1h 34m (-17.0%)
  6. x86_64-rust-for-linux: 45m 36s -> 53m 10s (+16.6%)
  7. x86_64-gnu-distcheck: 2h 10m -> 2h 29m (+14.1%)
  8. dist-aarch64-msvc: 1h 45m -> 1h 59m (+13.1%)
  9. dist-aarch64-llvm-mingw: 1h 47m -> 1h 33m (-12.9%)
  10. i686-gnu-nopt-1: 2h 2m -> 2h 17m (+12.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (12ab1cf): 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)

Results (primary -0.5%, secondary -0.8%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.1%, 2.4%] 4
Regressions ❌
(secondary)
1.0% [1.0%, 1.0%] 1
Improvements ✅
(primary)
-3.6% [-3.9%, -3.3%] 3
Improvements ✅
(secondary)
-1.7% [-2.0%, -1.4%] 2
All ❌✅ (primary) -0.5% [-3.9%, 2.4%] 7

Cycles

Results (primary -3.8%, secondary 2.6%)

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)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
-3.8% [-3.8%, -3.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.8% [-3.8%, -3.8%] 1

Binary size

Results (primary 0.0%, 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.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 4

Bootstrap: 484.273s -> 482.203s (-0.43%)
Artifact size: 394.91 MiB -> 394.92 MiB (0.00%)

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

unused_assignments should provide more information for newcomers Point at assignment where unread previously assigned binding is overwritten

7 participants