Skip to content

Commit

Permalink
Revise ui test.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongmao86 committed Jan 29, 2020
1 parent b8fc3c7 commit 6db5b20
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/ui/single_component_use_path.fixed
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// run-rustfix
// compile-flags: --edition 2018
#![warn(clippy::single_component_use_path)]

extern crate semver;


fn main() {
let escaped = std::ascii::escape_default(b'\t');
println!("{}", escaped);
let version = semver::Version::parse("1.2.3").unwrap();
println!("Version: {}", version);
}
7 changes: 4 additions & 3 deletions tests/ui/single_component_use_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// compile-flags: --edition 2018
#![warn(clippy::single_component_use_path)]

use std;
extern crate semver;
use semver;

fn main() {
let escaped = std::ascii::escape_default(b'\t');
println!("{}", escaped);
let version = semver::Version::parse("1.2.3").unwrap();
println!("Version: {}", version);
}
19 changes: 15 additions & 4 deletions tests/ui/single_component_use_path.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
error: this import is redundant in 2018 edition
error[E0254]: the name `semver` is defined multiple times
--> $DIR/single_component_use_path.rs:5:5
|
LL | extern crate semver;
| -------------------- previous import of the extern crate `semver` here
LL | use semver;
| ^^^^^^ `semver` reimported here
|
= note: `semver` must be defined only once in the type namespace of this module

error: this import is redundant
--> $DIR/single_component_use_path.rs:5:1
|
LL | use std;
| ^^^^^^^^ help: remove it entirely
LL | use semver;
| ^^^^^^^^^^^ help: remove it entirely
|
= note: `-D clippy::single-component-use-path` implied by `-D warnings`

error: aborting due to previous error
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0254`.

0 comments on commit 6db5b20

Please sign in to comment.