Skip to content

Commit acdab00

Browse files
tommilligancalebcartwright
authored andcommitted
[review] check interaction with import grouping
1 parent 9b1b3d6 commit acdab00

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Diff for: tests/source/issue-5030.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
11
// rustfmt-imports_granularity: Item
2+
// rustfmt-group_imports: One
23

4+
// Confirm that attributes are duplicated to all items in the use statement
35
#[cfg(feature = "foo")]
46
use std::collections::{
57
HashMap,
68
HashSet,
79
};
10+
11+
// Separate the imports below from the ones above
12+
const A: usize = 0;
13+
14+
// Copying attrs works with import grouping as well
15+
#[cfg(feature = "foo")]
16+
use std::collections::{
17+
HashMap,
18+
HashSet,
19+
};
20+
21+
#[cfg(feature = "spam")]
22+
use qux::{bar, baz};

Diff for: tests/target/issue-5030.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
// rustfmt-imports_granularity: Item
2+
// rustfmt-group_imports: One
23

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;
318
#[cfg(feature = "foo")]
419
use std::collections::HashMap;
520
#[cfg(feature = "foo")]

0 commit comments

Comments
 (0)