]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/issue-5030.rs
:arrow_up: rust-analyzer
[rust.git] / src / tools / rustfmt / tests / target / issue-5030.rs
1 // rustfmt-imports_granularity: Item
2 // rustfmt-group_imports: One
3
4 // Confirm that attributes are duplicated to all items in the use statement
5 #[cfg(feature = "foo")]
6 use std::collections::HashMap;
7 #[cfg(feature = "foo")]
8 use std::collections::HashSet;
9
10 // Separate the imports below from the ones above
11 const A: usize = 0;
12
13 // Copying attrs works with import grouping as well
14 #[cfg(feature = "spam")]
15 use qux::bar;
16 #[cfg(feature = "spam")]
17 use qux::baz;
18 #[cfg(feature = "foo")]
19 use std::collections::HashMap;
20 #[cfg(feature = "foo")]
21 use std::collections::HashSet;