]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/single_component_path_imports.rs
Auto merge of #84620 - Dylan-DPC:rollup-wkv97im, r=Dylan-DPC
[rust.git] / src / tools / clippy / tests / ui / single_component_path_imports.rs
1 // run-rustfix
2 // edition:2018
3 #![warn(clippy::single_component_path_imports)]
4 #![allow(unused_imports)]
5
6 use regex;
7 use serde as edres;
8 pub use serde;
9
10 macro_rules! m {
11     () => {
12         use regex;
13     };
14 }
15
16 fn main() {
17     regex::Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
18
19     // False positive #5154, shouldn't trigger lint.
20     m!();
21 }
22
23 mod hello_mod {
24     use regex;
25     #[allow(dead_code)]
26     fn hello_mod() {}
27 }
28
29 mod hi_mod {
30     use self::regex::{Regex, RegexSet};
31     use regex;
32     #[allow(dead_code)]
33     fn hi_mod() {}
34 }