@@ -18,15 +18,13 @@ use {rustc_ast as ast, rustc_parse_format as parse};
18
18
use crate :: errors;
19
19
use crate :: util:: { ExprToSpannedString , expr_to_spanned_string} ;
20
20
21
- pub struct RawAsmArgs ( Vec < RawAsmArg > ) ;
22
-
23
21
pub struct RawAsmArg {
24
22
pub span : Span ,
25
23
pub attributes : ast:: AttrVec ,
26
24
pub kind : RawAsmArgKind ,
27
25
}
28
26
29
- enum RawAsmArgKind {
27
+ pub enum RawAsmArgKind {
30
28
Template ( P < ast:: Expr > ) ,
31
29
Operand ( Option < Symbol > , ast:: InlineAsmOperand ) ,
32
30
Options ( Vec < ( Symbol , ast:: InlineAsmOptions , Span , Span ) > ) ,
@@ -475,52 +473,6 @@ pub fn parse_asm_args<'a>(
475
473
Ok ( args)
476
474
}
477
475
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
-
524
476
fn parse_options < ' a > (
525
477
p : & mut Parser < ' a > ,
526
478
asm_macro : AsmMacro ,
0 commit comments