-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
unused_imports
redundant import is already defined here
points to self
#121915
Comments
I believe it is pointing at the correct place (the |
Normally you see something like: Compiling playground v0.0.1 (/playground)
warning: the item `TryFrom` is imported redundantly
--> src/main.rs:3:5
|
3 | use std::convert::TryFrom;//~ WARNING the item `TryFrom` is imported redundantly
| ^^^^^^^^^^^^^^^^^^^^^
|
::: /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: the lint level is defined here
--> src/main.rs:1:9 Here it says where #![warn(unused_imports)]
use std::convert::TryFrom;//~ WARNING the item `TryFrom` is imported redundantly
use std::convert::TryInto;//~ WARNING the item `TryInto` is imported redundantly
fn main() {
let _e: Result<i32, _> = 8u8.try_into();
let _f: Result<i32, _> = i32::try_from(8u8);
} |
Yes, exactly! We just need to adjust the contents of the label in this situation. |
Minimized: // --- dep.rs --- rustc dep.rs --crate-type=lib
pub fn item() {} // --- usr.rs --- rustc usr.rs --extern=dep -L. --edition=2021
fn main() {
use dep;
dep::item();
}
|
…t, r=pnkfelix Fix redundant import errors for preload extern crate Fixes rust-lang#121915
…t, r=petrochenkov Fix redundant import errors for preload extern crate Fixes rust-lang#121915
Rollup merge of rust-lang#121958 - chenyukang:yukang-fix-121915-import, r=petrochenkov Fix redundant import errors for preload extern crate Fixes rust-lang#121915
is already defined here
doesn't point to the proper place:playground link
in this output:
for this code:
Meta
rustc --version --verbose
:initially mentioned it here, on the pull request: #117772 (comment)
The text was updated successfully, but these errors were encountered: