@@ -10,7 +10,6 @@ use rustc_index::bit_set::GrowableBitSet;
10
10
use rustc_parse:: parser:: Parser ;
11
11
use rustc_parse_format as parse;
12
12
use rustc_session:: lint;
13
- use rustc_session:: parse:: ParseSess ;
14
13
use rustc_span:: symbol:: Ident ;
15
14
use rustc_span:: symbol:: { kw, sym, Symbol } ;
16
15
use rustc_span:: { ErrorGuaranteed , InnerSpan , Span } ;
@@ -36,19 +35,17 @@ fn parse_args<'a>(
36
35
is_global_asm : bool ,
37
36
) -> PResult < ' a , AsmArgs > {
38
37
let mut p = ecx. new_parser_from_tts ( tts) ;
39
- let sess = & ecx. sess . parse_sess ;
40
- parse_asm_args ( & mut p, sess, sp, is_global_asm)
38
+ parse_asm_args ( & mut p, sp, is_global_asm)
41
39
}
42
40
43
41
// Primarily public for rustfmt consumption.
44
42
// Internal consumers should continue to leverage `expand_asm`/`expand__global_asm`
45
43
pub fn parse_asm_args < ' a > (
46
44
p : & mut Parser < ' a > ,
47
- sess : & ' a ParseSess ,
48
45
sp : Span ,
49
46
is_global_asm : bool ,
50
47
) -> PResult < ' a , AsmArgs > {
51
- let dcx = & sess . dcx ;
48
+ let dcx = & p . psess . dcx ;
52
49
53
50
if p. token == token:: Eof {
54
51
return Err ( dcx. create_err ( errors:: AsmRequiresTemplate { span : sp } ) ) ;
@@ -299,7 +296,7 @@ pub fn parse_asm_args<'a>(
299
296
fn err_duplicate_option ( p : & mut Parser < ' _ > , symbol : Symbol , span : Span ) {
300
297
// Tool-only output
301
298
let full_span = if p. token . kind == token:: Comma { span. to ( p. token . span ) } else { span } ;
302
- p. sess . dcx . emit_err ( errors:: AsmOptAlreadyprovided { span, symbol, full_span } ) ;
299
+ p. psess . dcx . emit_err ( errors:: AsmOptAlreadyprovided { span, symbol, full_span } ) ;
303
300
}
304
301
305
302
/// Try to set the provided option in the provided `AsmArgs`.
@@ -371,7 +368,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a,
371
368
p. expect ( & token:: OpenDelim ( Delimiter :: Parenthesis ) ) ?;
372
369
373
370
if p. eat ( & token:: CloseDelim ( Delimiter :: Parenthesis ) ) {
374
- return Err ( p. sess . dcx . create_err ( errors:: NonABI { span : p. token . span } ) ) ;
371
+ return Err ( p. psess . dcx . create_err ( errors:: NonABI { span : p. token . span } ) ) ;
375
372
}
376
373
377
374
let mut new_abis = Vec :: new ( ) ;
@@ -382,7 +379,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a,
382
379
}
383
380
Err ( opt_lit) => {
384
381
let span = opt_lit. map_or ( p. token . span , |lit| lit. span ) ;
385
- let mut err = p. sess . dcx . struct_span_err ( span, "expected string literal" ) ;
382
+ let mut err = p. psess . dcx . struct_span_err ( span, "expected string literal" ) ;
386
383
err. span_label ( span, "not a string literal" ) ;
387
384
return Err ( err) ;
388
385
}
@@ -498,15 +495,15 @@ fn expand_preparsed_asm(
498
495
} ;
499
496
500
497
if template_str. contains ( ".intel_syntax" ) {
501
- ecx. parse_sess ( ) . buffer_lint (
498
+ ecx. psess ( ) . buffer_lint (
502
499
lint:: builtin:: BAD_ASM_STYLE ,
503
500
find_span ( ".intel_syntax" ) ,
504
501
ecx. current_expansion . lint_node_id ,
505
502
"avoid using `.intel_syntax`, Intel syntax is the default" ,
506
503
) ;
507
504
}
508
505
if template_str. contains ( ".att_syntax" ) {
509
- ecx. parse_sess ( ) . buffer_lint (
506
+ ecx. psess ( ) . buffer_lint (
510
507
lint:: builtin:: BAD_ASM_STYLE ,
511
508
find_span ( ".att_syntax" ) ,
512
509
ecx. current_expansion . lint_node_id ,
0 commit comments