Closed
Description
Code
I tried this code:
struct Foo(u16);
pub fn use_foo() {
let _ = Foo(0);
}
impl Foo {
pub const BAR: Self = Self(123);
}
impl PartialEq<Foo> for u16 {
fn eq(&self, other: &Foo) -> bool {
*self == other.0
}
}
I expected to see this happen: I expected to see a dead_code
warning for Foo::BAR
.
Instead, this happened: No warning is emitted.
Version it worked on
It most recently worked on: Rust 1.70
Version with regression
rustc --version --verbose
:
rustc 1.71.1 (eb26296b5 2023-08-03)
binary: rustc
commit-hash: eb26296b556cef10fb713a38f3d16b9886080f26
commit-date: 2023-08-03
host: x86_64-unknown-linux-gnu
release: 1.71.1
LLVM version: 16.0.5
Backtrace
N/A
@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged