@@ -18,15 +18,13 @@ use {rustc_ast as ast, rustc_parse_format as parse};
1818use crate :: errors;
1919use crate :: util:: { ExprToSpannedString , expr_to_spanned_string} ;
2020
21- pub struct RawAsmArgs ( Vec < RawAsmArg > ) ;
22-
2321pub struct RawAsmArg {
2422 pub span : Span ,
2523 pub attributes : ast:: AttrVec ,
2624 pub kind : RawAsmArgKind ,
2725}
2826
29- enum RawAsmArgKind {
27+ pub enum RawAsmArgKind {
3028 Template ( P < ast:: Expr > ) ,
3129 Operand ( Option < Symbol > , ast:: InlineAsmOperand ) ,
3230 Options ( Vec < ( Symbol , ast:: InlineAsmOptions , Span , Span ) > ) ,
@@ -475,52 +473,6 @@ pub fn parse_asm_args<'a>(
475473 Ok ( args)
476474}
477475
478- /// Report a duplicate option error.
479- ///
480- /// This function must be called immediately after the option token is parsed.
481- /// Otherwise, the suggestion will be incorrect.
482- fn err_duplicate_option ( p : & Parser < ' _ > , symbol : Symbol , span : Span ) {
483- // Tool-only output
484- let full_span = if p. token == token:: Comma { span. to ( p. token . span ) } else { span } ;
485- p. dcx ( ) . emit_err ( errors:: AsmOptAlreadyprovided { span, symbol, full_span } ) ;
486- }
487-
488- /// Report an invalid option error.
489- ///
490- /// This function must be called immediately after the option token is parsed.
491- /// Otherwise, the suggestion will be incorrect.
492- fn err_unsupported_option ( p : & Parser < ' _ > , asm_macro : AsmMacro , symbol : Symbol , span : Span ) {
493- // Tool-only output
494- let full_span = if p. token == token:: Comma { span. to ( p. token . span ) } else { span } ;
495- p. dcx ( ) . emit_err ( errors:: AsmUnsupportedOption {
496- span,
497- symbol,
498- full_span,
499- macro_name : asm_macro. macro_name ( ) ,
500- } ) ;
501- }
502-
503- /// Try to set the provided option in the provided `AsmArgs`.
504- /// If it is already set, report a duplicate option error.
505- ///
506- /// This function must be called immediately after the option token is parsed.
507- /// Otherwise, the error will not point to the correct spot.
508- fn try_set_option < ' a > (
509- p : & Parser < ' a > ,
510- args : & mut AsmArgs ,
511- asm_macro : AsmMacro ,
512- symbol : Symbol ,
513- option : ast:: InlineAsmOptions ,
514- ) {
515- if !asm_macro. is_supported_option ( option) {
516- err_unsupported_option ( p, asm_macro, symbol, p. prev_token . span ) ;
517- } else if args. options . contains ( option) {
518- err_duplicate_option ( p, symbol, p. prev_token . span ) ;
519- } else {
520- args. options |= option;
521- }
522- }
523-
524476fn parse_options < ' a > (
525477 p : & mut Parser < ' a > ,
526478 asm_macro : AsmMacro ,
0 commit comments