Skip to content

Commit 7399580

Browse files
committed
util/dev fmt.
1 parent 02a9517 commit 7399580

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

clippy_lints/src/single_component_path_imports.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::utils::span_lint_and_sugg;
2-
use rustc_lint::{EarlyLintPass, EarlyContext};
3-
use rustc_session::{declare_lint_pass, declare_tool_lint};
4-
use syntax::ast::{Item, ItemKind, UseTreeKind};
52
use if_chain::if_chain;
63
use rustc_errors::Applicability;
4+
use rustc_lint::{EarlyContext, EarlyLintPass};
5+
use rustc_session::{declare_lint_pass, declare_tool_lint};
76
use rustc_span::edition::Edition;
7+
use syntax::ast::{Item, ItemKind, UseTreeKind};
88

99
declare_clippy_lint! {
1010
/// **What it does:** Checking for imports with single component use path.
@@ -15,7 +15,7 @@ declare_clippy_lint! {
1515
/// **Known problems:** None.
1616
///
1717
/// **Example:**
18-
///
18+
///
1919
/// ```rust, ignore
2020
/// use regex;
2121
///

tests/ui/single_component_path_imports.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// compile-flags: --edition 2018
33
#![warn(clippy::single_component_path_imports)]
44

5-
5+
use regex;
66

77
fn main() {
88
regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
error: this import is redundant
2-
--> $DIR/single_component_path_imports.rs:5:1
1+
error[E0465]: multiple rlib candidates for `regex` found
2+
--> $DIR/single_component_path_imports.rs:5:5
33
|
44
LL | use regex;
5-
| ^^^^^^^^^^ help: remove it entirely
5+
| ^^^^^
66
|
7-
= note: `-D clippy::single-component-path-imports` implied by `-D warnings`
7+
note: candidate #1: /home/rui/rust-clippy/target/debug/deps/libregex-eb8182d3b38305f5.rlib
8+
--> $DIR/single_component_path_imports.rs:5:5
9+
|
10+
LL | use regex;
11+
| ^^^^^
12+
note: candidate #2: /home/rui/rust-clippy/target/debug/deps/libregex-ecf6ddab71485867.rlib
13+
--> $DIR/single_component_path_imports.rs:5:5
14+
|
15+
LL | use regex;
16+
| ^^^^^
17+
18+
error[E0463]: can't find crate for `regex`
19+
--> $DIR/single_component_path_imports.rs:5:5
20+
|
21+
LL | use regex;
22+
| ^^^^^ can't find crate
823

9-
error: aborting due to previous error
24+
error: aborting due to 2 previous errors
1025

26+
For more information about this error, try `rustc --explain E0463`.

0 commit comments

Comments
 (0)