File tree Expand file tree Collapse file tree 5 files changed +7
-10
lines changed Expand file tree Collapse file tree 5 files changed +7
-10
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- use Shape ;
11
+ use { Indent , Shape } ;
12
12
use comment:: { rewrite_comment, CodeCharKind , CommentCodeSlices } ;
13
13
use config:: WriteMode ;
14
14
use syntax:: codemap:: { BytePos , Pos , Span } ;
@@ -169,11 +169,12 @@ impl<'a> FmtVisitor<'a> {
169
169
self . config . comment_width ( ) ,
170
170
self . config . max_width ( ) - self . block_indent . width ( ) ,
171
171
) ;
172
+ let comment_indent = Indent :: from_width ( self . config , self . buffer . cur_offset ( ) ) ;
172
173
173
174
self . buffer . push_str ( & rewrite_comment (
174
175
subslice,
175
176
false ,
176
- Shape :: legacy ( comment_width, self . block_indent ) ,
177
+ Shape :: legacy ( comment_width, comment_indent ) ,
177
178
self . config ,
178
179
) . unwrap ( ) ) ;
179
180
Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ fn test() {
9
9
// comment
10
10
// comment2
11
11
12
- // FIXME(1275)
13
12
code ( ) ; /* leave this comment alone!
14
13
* ok? */
15
14
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ fn test() {
5
5
// comment
6
6
// comment2
7
7
8
- // FIXME(1275)
9
8
code ( ) ; /* leave this comment alone!
10
9
* ok? */
11
10
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ fn test() {
9
9
// comment
10
10
// comment2
11
11
12
- // FIXME(1275)
13
12
code ( ) ; // leave this comment alone!
14
- // ok?
13
+ // ok?
15
14
16
15
// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
17
16
// diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
@@ -33,7 +32,7 @@ fn test() {
33
32
// .unwrap());
34
33
35
34
funk ( ) ; // dontchangeme
36
- // or me
35
+ // or me
37
36
38
37
// #1388
39
38
const EXCEPTION_PATHS : & ' static [ & ' static str ] = & [
Original file line number Diff line number Diff line change @@ -5,9 +5,8 @@ fn test() {
5
5
// comment
6
6
// comment2
7
7
8
- // FIXME(1275)
9
8
code ( ) ; /* leave this comment alone!
10
- * ok? */
9
+ * ok? */
11
10
12
11
/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a
13
12
* diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
@@ -28,7 +27,7 @@ fn test() {
28
27
// .unwrap());
29
28
30
29
funk ( ) ; //dontchangeme
31
- // or me
30
+ // or me
32
31
}
33
32
34
33
/// test123
You can’t perform that action at this time.
0 commit comments