Skip to content

Commit 69f2d1d

Browse files
committed
add test for 3984
This is fixed by backporting 3999
1 parent ec54d65 commit 69f2d1d

10 files changed

+150
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Crate
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item /* comment */;
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Item
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item /* comment */;
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Module
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item /* comment */;
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: One
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item /* comment */;
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Preserve
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item /* comment */;
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Crate
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item; /* comment */
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Item
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item; /* comment */
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Module
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item; /* comment */
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: One
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item; /* comment */
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// rustfmt-imports_granularity: Preserve
2+
3+
// See https://github.com/rust-lang/rustfmt/issues/3984
4+
use a::{item /* comment */};
5+
use b::{
6+
a,
7+
// comment
8+
item,
9+
};
10+
use c::item; /* comment */
11+
use d::item; // really long comment (with `use` exactly 100 characters) ____________________________
12+
13+
use std::e::{/* it's a comment! */ bar /* and another */};
14+
use std::f::{/* it's a comment! */ bar};
15+
use std::g::{bar /* and another */};

0 commit comments

Comments
 (0)