Skip to content

Commit 6db5b20

Browse files
committed
Revise ui test.
1 parent b8fc3c7 commit 6db5b20

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// run-rustfix
2-
// compile-flags: --edition 2018
32
#![warn(clippy::single_component_use_path)]
43

4+
extern crate semver;
55

66

77
fn 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
}

tests/ui/single_component_use_path.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// compile-flags: --edition 2018
33
#![warn(clippy::single_component_use_path)]
44

5-
use std;
5+
extern crate semver;
6+
use semver;
67

78
fn 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
}
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
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`.

0 commit comments

Comments
 (0)