-
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.T-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
I tried this code:
pub fn bar() -> u64 {
::core::default::Default::default()
}
fn main() {}
I expected to see it pass with unused_qualifications
lints. As it does on stable
.
$ cargo clippy -- -W unused_qualifications
Checking foo v0.1.0 (/home/user/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.06s
Instead, nightly
suggests to replace the global path.
$ cargo +nightly clippy -- -W unused_qualifications
Checking foo v0.1.0 (/home/user/foo)
warning: unnecessary qualification
--> src/main.rs:2:5
|
2 | ::core::default::Default::default()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: requested on the command line with `-W unused-qualifications`
help: remove the unnecessary path segments
|
2 - ::core::default::Default::default()
2 + Default::default()
|
Meta
$ rustc +nightly --version --verbose
rustc 1.78.0-nightly (4a0cc881d 2024-03-11)
binary: rustc
commit-hash: 4a0cc881dcc4d800f10672747f61a94377ff6662
commit-date: 2024-03-11
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
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.T-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.