File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 10
10
11
11
//! Reorder items.
12
12
//!
13
- //! `mod`, `extern crate` and `use` declarations are reorderd in alphabetical
13
+ //! `mod`, `extern crate` and `use` declarations are reordered in alphabetical
14
14
//! order. Trait items are reordered in pre-determined order (associated types
15
15
//! and constants comes before methods).
16
16
@@ -28,7 +28,7 @@ use rewrite::{Rewrite, RewriteContext};
28
28
use shape:: Shape ;
29
29
use source_map:: LineRangeUtils ;
30
30
use spanned:: Spanned ;
31
- use utils:: mk_sp;
31
+ use utils:: { contains_skip , mk_sp} ;
32
32
use visitor:: FmtVisitor ;
33
33
34
34
use std:: cmp:: { Ord , Ordering } ;
@@ -186,7 +186,9 @@ enum ReorderableItemKind {
186
186
impl ReorderableItemKind {
187
187
fn from ( item : & ast:: Item ) -> Self {
188
188
match item. node {
189
- _ if contains_macro_use_attr ( item) => ReorderableItemKind :: Other ,
189
+ _ if contains_macro_use_attr ( item) | contains_skip ( & item. attrs ) => {
190
+ ReorderableItemKind :: Other
191
+ }
190
192
ast:: ItemKind :: ExternCrate ( ..) => ReorderableItemKind :: ExternCrate ,
191
193
ast:: ItemKind :: Mod ( ..) if is_mod_decl ( item) => ReorderableItemKind :: Mod ,
192
194
ast:: ItemKind :: Use ( ..) => ReorderableItemKind :: Use ,
Original file line number Diff line number Diff line change @@ -101,3 +101,7 @@ use imports_with_attr;
101
101
102
102
// #2888
103
103
use std:: f64:: consts:: { SQRT_2 , E , PI } ;
104
+
105
+ // #3273
106
+ #[ rustfmt:: skip]
107
+ use std:: fmt:: { self , { Display , Formatter } } ;
Original file line number Diff line number Diff line change @@ -123,3 +123,7 @@ use imports_with_attr;
123
123
124
124
// #2888
125
125
use std:: f64:: consts:: { E , PI , SQRT_2 } ;
126
+
127
+ // #3273
128
+ #[ rustfmt:: skip]
129
+ use std:: fmt:: { self , { Display , Formatter } } ;
You can’t perform that action at this time.
0 commit comments