@@ -6,14 +6,13 @@ use rustc_expand::base::*;
66use rustc_index:: bit_set:: GrowableBitSet ;
77use rustc_parse:: parser:: asm:: * ;
88use rustc_session:: lint;
9- use rustc_session:: parse:: feature_err;
109use rustc_span:: { ErrorGuaranteed , InnerSpan , Span , Symbol , sym} ;
1110use rustc_target:: asm:: InlineAsmArch ;
1211use smallvec:: smallvec;
1312use { rustc_ast as ast, rustc_parse_format as parse} ;
1413
14+ use crate :: errors;
1515use crate :: util:: { ExprToSpannedString , expr_to_spanned_string} ;
16- use crate :: { errors, fluent_generated as fluent} ;
1716
1817/// Validated assembly arguments, ready for macro expansion.
1918struct ValidatedAsmArgs {
@@ -64,22 +63,13 @@ fn validate_asm_args<'a>(
6463
6564 for arg in args {
6665 for attr in arg. attributes . 0 . iter ( ) {
67- match attr. name ( ) {
68- Some ( sym:: cfg | sym:: cfg_attr) => {
69- if !ecx. ecfg . features . asm_cfg ( ) {
70- let span = attr. span ( ) ;
71- feature_err ( ecx. sess , sym:: asm_cfg, span, fluent:: builtin_macros_asm_cfg)
72- . emit ( ) ;
73- }
74- }
75- _ => {
76- ecx. dcx ( ) . emit_err ( errors:: AsmAttributeNotSupported { span : attr. span ( ) } ) ;
77- }
66+ if !matches ! ( attr. name( ) , Some ( sym:: cfg | sym:: cfg_attr) ) {
67+ ecx. dcx ( ) . emit_err ( errors:: AsmAttributeNotSupported { span : attr. span ( ) } ) ;
7868 }
7969 }
8070
8171 // Skip arguments that are configured out.
82- if ecx . ecfg . features . asm_cfg ( ) && strip_unconfigured. configure ( arg. attributes ) . is_none ( ) {
72+ if strip_unconfigured. configure ( arg. attributes ) . is_none ( ) {
8373 continue ;
8474 }
8575
0 commit comments