diff options
Diffstat (limited to 'src/tools/rustfmt/tests/source/issue-5030.rs')
-rw-r--r-- | src/tools/rustfmt/tests/source/issue-5030.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/issue-5030.rs b/src/tools/rustfmt/tests/source/issue-5030.rs new file mode 100644 index 000000000..08ffaac7d --- /dev/null +++ b/src/tools/rustfmt/tests/source/issue-5030.rs @@ -0,0 +1,22 @@ +// rustfmt-imports_granularity: Item +// rustfmt-group_imports: One + +// Confirm that attributes are duplicated to all items in the use statement +#[cfg(feature = "foo")] +use std::collections::{ + HashMap, + HashSet, +}; + +// Separate the imports below from the ones above +const A: usize = 0; + +// Copying attrs works with import grouping as well +#[cfg(feature = "foo")] +use std::collections::{ + HashMap, + HashSet, +}; + +#[cfg(feature = "spam")] +use qux::{bar, baz}; |