-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-lint_reasons`#![feature(lint_reasons)]``#![feature(lint_reasons)]`L-unused_importsLint: unused_importsLint: unused_importsT-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.
Description
the following snippet:
#[expect(unused_imports)]
use std::{io, fs};
results in the following compiler output:
warning: this lint expectation is unfulfilled
--> src/main.rs:2:10
|
2 | #[expect(unused_imports)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
but removing the #[expect]
results in:
warning: unused imports: `fs` and `io`
--> src/main.rs:2:11
|
2 | use std::{io, fs};
| ^^ ^^
|
= note: `#[warn(unused_imports)]` on by default
so it is, indeed, supressing the lint - which means the first warning is wrong. it is important to note that the same does not happen on imports of a single item.
rustc version:
rustc 1.81.0-nightly (24d2ac0b5 2024-07-15)
binary: rustc
commit-hash: 24d2ac0b56fcbde13d827745f66e73efb1e17156
commit-date: 2024-07-15
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.Category: This is a bug.F-lint_reasons`#![feature(lint_reasons)]``#![feature(lint_reasons)]`L-unused_importsLint: unused_importsLint: unused_importsT-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.