diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-08-16 18:04:58 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-08-21 13:15:30 +0200 |
| commit | 9da854115fd4760b5e250d97a3a872d08e222426 (patch) | |
| tree | 7f6d4afa209fa8eb3077bee06b6aedef05b7a356 /compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs | |
| parent | 2158e2d4d7b2722325de01530296c4e93297c06f (diff) | |
| download | rust-9da854115fd4760b5e250d97a3a872d08e222426.tar.gz rust-9da854115fd4760b5e250d97a3a872d08e222426.zip | |
Introduce a prelude for very common imports across dozens of files
Diffstat (limited to 'compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs index f0d14bb1a46..180130c7be4 100644 --- a/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/macro_attrs.rs @@ -1,16 +1,8 @@ use rustc_errors::DiagArgValue; -use rustc_feature::{AttributeTemplate, template}; -use rustc_hir::Target; -use rustc_hir::attrs::{AttributeKind, MacroUseArgs}; -use rustc_span::{Span, Symbol, sym}; -use thin_vec::ThinVec; +use rustc_hir::attrs::MacroUseArgs; -use crate::attributes::{AcceptMapping, AttributeParser, NoArgsAttributeParser, OnDuplicate}; -use crate::context::{AcceptContext, FinalizeContext, Stage}; -use crate::parser::ArgParser; -use crate::session_diagnostics; -use crate::target_checking::AllowedTargets; -use crate::target_checking::Policy::{Allow, Error, Warn}; +use super::prelude::*; +use crate::session_diagnostics::IllFormedAttributeInputLint; pub(crate) struct MacroEscapeParser; impl<S: Stage> NoArgsAttributeParser<S> for MacroEscapeParser { @@ -110,7 +102,7 @@ impl<S: Stage> AttributeParser<S> for MacroUseParser { } ArgParser::NameValue(_) => { let suggestions = MACRO_USE_TEMPLATE.suggestions(cx.attr_style, sym::macro_use); - cx.emit_err(session_diagnostics::IllFormedAttributeInputLint { + cx.emit_err(IllFormedAttributeInputLint { num_suggestions: suggestions.len(), suggestions: DiagArgValue::StrListSepByAnd( suggestions.into_iter().map(|s| format!("`{s}`").into()).collect(), |
