-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
I've only tried two versions available on rust playground.
I'm not quite sure what behaviour is better or worse, but a change between stable and beta is at least worth mentioning in changelogs. I have not found any relevant issues about unused_assignments lint change, so I believe this may be in fact unintended.
I've noticed that when my cargo check have failed in CI (running stable), but succeeded locally (running nightly).
Code
I tried this code:
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {}
}
fn main() {
let mut foo = Foo;
foo = Foo;
}I expected to see this happen:
warning: variable `foo` is assigned to, but never used
--> src/main.rs:8:13
|
8 | let mut foo = Foo;
| ^^^
|
= note: consider using `_foo` instead
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
help: you might have meant to pattern match on the similarly named struct `Foo` (notice the capitalization)
|
8 - let mut foo = Foo;
8 + let mut Foo = Foo;
|
warning: value assigned to `foo` is never read
--> src/main.rs:9:5
|
9 | foo = Foo;
| ^^^
|
= help: maybe it is overwritten before being read?
= note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default
Instead, this happened: (no warnings)
Compiling playground v0.0.1 (/playground)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.46s
Running `target/debug/playground`
Version it worked on
It most recently worked on: 1.91.0
Version with regression
1.92.0-beta.2 (2025-10-31 0a411606e9cc00588c83)
@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.