From 73847d3986f9bc66dbd46989a8fc3b8c1aa23876 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Mon, 19 Aug 2019 10:56:32 +0900 Subject: [PATCH] Take the inner macro_use attr into acocunt while reordering (#3749) --- src/lib.rs | 4 +--- src/reorder.rs | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index dbb7d2e0e17..2e43b9d8c7e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,9 +41,6 @@ pub use crate::rustfmt_diff::{ModifiedChunk, ModifiedLines}; #[macro_use] mod utils; -#[macro_use] -mod release_channel; - mod attr; mod chains; mod closures; @@ -66,6 +63,7 @@ pub(crate) mod modules; mod overflow; mod pairs; mod patterns; +mod release_channel; mod reorder; mod rewrite; pub(crate) mod rustfmt_diff; diff --git a/src/reorder.rs b/src/reorder.rs index a246772f648..43a788c6339 100644 --- a/src/reorder.rs +++ b/src/reorder.rs @@ -10,7 +10,6 @@ use std::cmp::{Ord, Ordering}; use syntax::{ast, attr, source_map::Span, symbol::sym}; -use crate::attr::filter_inline_attrs; use crate::config::Config; use crate::imports::{merge_use_trees, UseTree}; use crate::items::{is_mod_decl, rewrite_extern_crate, rewrite_mod}; @@ -149,10 +148,7 @@ fn rewrite_reorderable_items( } fn contains_macro_use_attr(item: &ast::Item) -> bool { - attr::contains_name( - &filter_inline_attrs(&item.attrs, item.span()), - sym::macro_use, - ) + attr::contains_name(&item.attrs, sym::macro_use) } /// A simplified version of `ast::ItemKind`.