a61126cef6
fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
warning: the item `Some` is imported redundantly
|
|
--> $DIR/use-redundant-prelude-rust-2015.rs:5:5
|
|
|
|
|
LL | use std::option::Option::Some;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
|
|
|
|
|
= note: the item `Some` is already defined here
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/use-redundant-prelude-rust-2015.rs:2:9
|
|
|
|
|
LL | #![warn(unused_imports)]
|
|
| ^^^^^^^^^^^^^^
|
|
|
|
warning: the item `None` is imported redundantly
|
|
--> $DIR/use-redundant-prelude-rust-2015.rs:6:5
|
|
|
|
|
LL | use std::option::Option::None;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
|
|
|
|
|
= note: the item `None` is already defined here
|
|
|
|
warning: the item `Ok` is imported redundantly
|
|
--> $DIR/use-redundant-prelude-rust-2015.rs:8:5
|
|
|
|
|
LL | use std::result::Result::Ok;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
|
|
|
|
|
= note: the item `Ok` is already defined here
|
|
|
|
warning: the item `Err` is imported redundantly
|
|
--> $DIR/use-redundant-prelude-rust-2015.rs:9:5
|
|
|
|
|
LL | use std::result::Result::Err;
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL
|
|
|
|
|
= note: the item `Err` is already defined here
|
|
|
|
warning: 4 warnings emitted
|
|
|