File tree Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Expand file tree Collapse file tree 3 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -684,18 +684,13 @@ impl<'a> FmtVisitor<'a> {
684
684
return false ;
685
685
}
686
686
687
- let first = & attrs[ 0 ] ;
688
- self . format_missing_with_indent ( source ! ( self , first. span) . lo ) ;
689
-
690
- let rewrite = attrs
691
- . rewrite (
692
- & self . get_context ( ) ,
693
- Shape :: indented ( self . block_indent , self . config ) ,
694
- )
695
- . unwrap ( ) ;
696
- self . buffer . push_str ( & rewrite) ;
697
- let last = attrs. last ( ) . unwrap ( ) ;
698
- self . last_pos = source ! ( self , last. span) . hi ;
687
+ let rewrite = attrs. rewrite (
688
+ & self . get_context ( ) ,
689
+ Shape :: indented ( self . block_indent , self . config ) ,
690
+ ) ;
691
+ let span = mk_sp ( attrs[ 0 ] . span . lo , attrs[ attrs. len ( ) - 1 ] . span . hi ) ;
692
+ self . push_rewrite ( span, rewrite) ;
693
+
699
694
false
700
695
}
701
696
Original file line number Diff line number Diff line change 1
1
// rustfmt-wrap_comments: true
2
2
// Test attributes and doc comments are preserved.
3
3
4
+ #[ invalid attribute]
5
+ fn foo ( ) { }
6
+
4
7
/// Blah blah blah.
5
8
/// Blah blah blah.
6
9
/// Blah blah blah.
Original file line number Diff line number Diff line change 1
1
// rustfmt-wrap_comments: true
2
2
// Test attributes and doc comments are preserved.
3
3
4
+ #[ invalid attribute]
5
+ fn foo ( ) { }
6
+
4
7
/// Blah blah blah.
5
8
/// Blah blah blah.
6
9
/// Blah blah blah.
You can’t perform that action at this time.
0 commit comments