diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs index cd431f57019..5679cdcbbd0 100644 --- a/compiler/rustc_expand/src/mbe/macro_rules.rs +++ b/compiler/rustc_expand/src/mbe/macro_rules.rs @@ -16,7 +16,6 @@ use rustc_ast_pretty::pprust; use rustc_attr::{self as attr, TransparencyError}; use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; use rustc_errors::{Applicability, ErrorGuaranteed}; -use rustc_feature::Features; use rustc_lint_defs::builtin::{ RUST_2021_INCOMPATIBLE_OR_PATTERNS, SEMICOLON_IN_EXPRESSIONS_FROM_MACROS, }; @@ -379,7 +378,6 @@ pub(super) fn try_match_macro<'matcher, T: Tracker<'matcher>>( /// Converts a macro item into a syntax extension. pub fn compile_declarative_macro( sess: &Session, - features: &Features, def: &ast::Item, edition: Edition, ) -> (SyntaxExtension, Vec<(usize, Span)>) { @@ -508,7 +506,7 @@ pub fn compile_declarative_macro( true, &sess.parse_sess, def.id, - features, + sess.features_untracked(), edition, ) .pop() @@ -532,7 +530,7 @@ pub fn compile_declarative_macro( false, &sess.parse_sess, def.id, - features, + sess.features_untracked(), edition, ) .pop() diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 403df94897a..341db774b4d 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -878,12 +878,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { item: &ast::Item, edition: Edition, ) -> (SyntaxExtension, Vec<(usize, Span)>) { - let (mut result, mut rule_spans) = compile_declarative_macro( - &self.tcx.sess, - self.tcx.sess.features_untracked(), - item, - edition, - ); + let (mut result, mut rule_spans) = compile_declarative_macro(self.tcx.sess, item, edition); if let Some(builtin_name) = result.builtin_name { // The macro was marked with `#[rustc_builtin_macro]`.