File tree Expand file tree Collapse file tree 3 files changed +22
-10
lines changed
Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 11// run-rustfix
2- // compile-flags: --edition 2018
32#![warn(clippy::single_component_use_path)]
43
4+ extern crate semver;
55
66
77fn main() {
8- let escaped = std::ascii::escape_default(b'\t' );
9- println!("{}", escaped );
8+ let version = semver::Version::parse("1.2.3").unwrap( );
9+ println!("Version: {}", version );
1010}
Original file line number Diff line number Diff line change 22// compile-flags: --edition 2018
33#![ warn( clippy:: single_component_use_path) ]
44
5- use std;
5+ extern crate semver;
6+ use semver;
67
78fn main ( ) {
8- let escaped = std :: ascii :: escape_default ( b'\t' ) ;
9- println ! ( "{}" , escaped ) ;
9+ let version = semver :: Version :: parse ( "1.2.3" ) . unwrap ( ) ;
10+ println ! ( "Version: {}" , version ) ;
1011}
Original file line number Diff line number Diff line change 1- error: this import is redundant in 2018 edition
1+ error[E0254]: the name `semver` is defined multiple times
2+ --> $DIR/single_component_use_path.rs:5:5
3+ |
4+ LL | extern crate semver;
5+ | -------------------- previous import of the extern crate `semver` here
6+ LL | use semver;
7+ | ^^^^^^ `semver` reimported here
8+ |
9+ = note: `semver` must be defined only once in the type namespace of this module
10+
11+ error: this import is redundant
212 --> $DIR/single_component_use_path.rs:5:1
313 |
4- LL | use std ;
5- | ^^^^^^^^ help: remove it entirely
14+ LL | use semver ;
15+ | ^^^^^^^^^^^ help: remove it entirely
616 |
717 = note: `-D clippy::single-component-use-path` implied by `-D warnings`
818
9- error: aborting due to previous error
19+ error: aborting due to 2 previous errors
1020
21+ For more information about this error, try `rustc --explain E0254`.
You can’t perform that action at this time.
0 commit comments