File tree 2 files changed +10
-16
lines changed
compiler/rustc_builtin_macros/src
src/tools/rustfmt/src/parse/macros
2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,7 @@ fn parse_asm_operand<'a>(
144
144
} ) )
145
145
}
146
146
147
+ // Public for rustfmt
147
148
pub fn parse_raw_asm_args < ' a > (
148
149
p : & mut Parser < ' a > ,
149
150
sp : Span ,
@@ -259,21 +260,11 @@ fn parse_args<'a>(
259
260
asm_macro : AsmMacro ,
260
261
) -> PResult < ' a , AsmArgs > {
261
262
let mut p = ecx. new_parser_from_tts ( tts) ;
262
- parse_asm_args ( & mut p, sp, asm_macro)
263
+ let raw_args = parse_raw_asm_args ( & mut p, sp, asm_macro) ?;
264
+ validate_raw_asm_args ( ecx. dcx ( ) , asm_macro, raw_args)
263
265
}
264
266
265
- // public for use in rustfmt
266
- // FIXME: use `RawAsmArg` in the formatting code instead.
267
- pub fn parse_asm_args < ' a > (
268
- p : & mut Parser < ' a > ,
269
- sp : Span ,
270
- asm_macro : AsmMacro ,
271
- ) -> PResult < ' a , AsmArgs > {
272
- let raw_args = parse_raw_asm_args ( p, sp, asm_macro) ?;
273
- validate_raw_asm_args ( p. dcx ( ) , asm_macro, raw_args)
274
- }
275
-
276
- pub fn validate_raw_asm_args < ' a > (
267
+ fn validate_raw_asm_args < ' a > (
277
268
dcx : DiagCtxtHandle < ' a > ,
278
269
asm_macro : AsmMacro ,
279
270
raw_args : Vec < RawAsmArg > ,
Original file line number Diff line number Diff line change 1
1
use rustc_ast:: ast;
2
- use rustc_builtin_macros:: asm:: { AsmArgs , parse_asm_args } ;
2
+ use rustc_builtin_macros:: asm:: { RawAsmArg , parse_raw_asm_args } ;
3
3
4
4
use crate :: rewrite:: RewriteContext ;
5
5
6
6
#[ allow( dead_code) ]
7
- pub ( crate ) fn parse_asm ( context : & RewriteContext < ' _ > , mac : & ast:: MacCall ) -> Option < AsmArgs > {
7
+ pub ( crate ) fn parse_asm (
8
+ context : & RewriteContext < ' _ > ,
9
+ mac : & ast:: MacCall ,
10
+ ) -> Option < Vec < RawAsmArgs > > {
8
11
let ts = mac. args . tokens . clone ( ) ;
9
12
let mut parser = super :: build_parser ( context, ts) ;
10
- parse_asm_args ( & mut parser, mac. span ( ) , ast:: AsmMacro :: Asm ) . ok ( )
13
+ parse_raw_asm_args ( & mut parser, mac. span ( ) , ast:: AsmMacro :: Asm ) . ok ( )
11
14
}
You can’t perform that action at this time.
0 commit comments