File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ pub fn path_to_imported_ident(path: &ast::Path) -> ast::Ident {
35
35
36
36
impl < ' a > FmtVisitor < ' a > {
37
37
pub fn format_import ( & mut self , item : & ast:: Item , tree : & ast:: UseTree ) {
38
- let span = item. span ;
38
+ let span = item. span ( ) ;
39
39
let shape = self . shape ( ) ;
40
40
let rw = UseTree :: from_ast (
41
41
& self . get_context ( ) ,
Original file line number Diff line number Diff line change @@ -303,6 +303,13 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
303
303
let filtered_attrs;
304
304
let mut attrs = & item. attrs ;
305
305
match item. node {
306
+ // For use items, skip rewriting attributes. Just check for a skip attribute.
307
+ ast:: ItemKind :: Use ( ..) => {
308
+ if contains_skip ( attrs) {
309
+ self . push_skipped_with_span ( item. span ( ) ) ;
310
+ return ;
311
+ }
312
+ }
306
313
// Module is inline, in this case we treat it like any other item.
307
314
_ if !is_mod_decl ( item) => {
308
315
if self . visit_attrs ( & item. attrs , ast:: AttrStyle :: Outer ) {
You can’t perform that action at this time.
0 commit comments