-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
Code
use std::convert::TryFrom;
pub trait Foo<T>: TryFrom<T> {}Current output
Compiling playground v0.0.1 (/playground)
warning: the item `TryFrom` is imported redundantly
--> src/lib.rs:1:5
|
1 | use std::convert::TryFrom;
| ^^^^^^^^^^^^^^^^^^^^^
|
::: /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude/mod.rs:129:13
|
129 | pub use core::prelude::rust_2021::*;
| ------------------------ the item `TryFrom` is already defined here
|
= note: `#[warn(unused_imports)]` on by defaultDesired output
Compiling playground v0.0.1 (/playground)
warning: the item `TryFrom` is imported redundantly
--> src/lib.rs:1:5
|
1 | use std::convert::TryFrom;
| ^^^^^^^^^^^^^^^^^^^^^
|
= note: `TryFrom` is imported in the 2021 edition prelude
= note: `#[warn(unused_imports)]` on by defaultRationale and extra context
The pub use core::prelude::rust_2021::*; import is a compiler detail. The user did not write that line so it's confusing to display it to them.
Other cases
No response
Rust Version
rustc 1.78.0-nightly (2bf78d12d 2024-02-18)
binary: rustc
commit-hash: 2bf78d12d33ae02d10010309a0d85dd04e7cff72
commit-date: 2024-02-18
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0Anything else?
Kixunil and kpreid
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.