Skip to content

Commit 73847d3

Browse files
authored
Take the inner macro_use attr into acocunt while reordering (rust-lang#3749)
1 parent 1643d72 commit 73847d3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ pub use crate::rustfmt_diff::{ModifiedChunk, ModifiedLines};
4141
#[macro_use]
4242
mod utils;
4343

44-
#[macro_use]
45-
mod release_channel;
46-
4744
mod attr;
4845
mod chains;
4946
mod closures;
@@ -66,6 +63,7 @@ pub(crate) mod modules;
6663
mod overflow;
6764
mod pairs;
6865
mod patterns;
66+
mod release_channel;
6967
mod reorder;
7068
mod rewrite;
7169
pub(crate) mod rustfmt_diff;

src/reorder.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use std::cmp::{Ord, Ordering};
1010

1111
use syntax::{ast, attr, source_map::Span, symbol::sym};
1212

13-
use crate::attr::filter_inline_attrs;
1413
use crate::config::Config;
1514
use crate::imports::{merge_use_trees, UseTree};
1615
use crate::items::{is_mod_decl, rewrite_extern_crate, rewrite_mod};
@@ -149,10 +148,7 @@ fn rewrite_reorderable_items(
149148
}
150149

151150
fn contains_macro_use_attr(item: &ast::Item) -> bool {
152-
attr::contains_name(
153-
&filter_inline_attrs(&item.attrs, item.span()),
154-
sym::macro_use,
155-
)
151+
attr::contains_name(&item.attrs, sym::macro_use)
156152
}
157153

158154
/// A simplified version of `ast::ItemKind`.

0 commit comments

Comments
 (0)