diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-04 16:31:49 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-03-05 08:11:45 +1100 |
| commit | 80d2bdb6191609c8a3940a1a7959ac1ac16e8ed6 (patch) | |
| tree | 828bd479b6f4dfa59a3fe1b4efe6f9439d0a216f /compiler/rustc_builtin_macros/src/asm.rs | |
| parent | 4260f7ec679dca38911e983113a0243fb8f905dc (diff) | |
| download | rust-80d2bdb6191609c8a3940a1a7959ac1ac16e8ed6.tar.gz rust-80d2bdb6191609c8a3940a1a7959ac1ac16e8ed6.zip | |
Rename all `ParseSess` variables/fields/lifetimes as `psess`.
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
Diffstat (limited to 'compiler/rustc_builtin_macros/src/asm.rs')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/asm.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index 359222afaec..38fa1ac5935 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -45,7 +45,7 @@ pub fn parse_asm_args<'a>( sp: Span, is_global_asm: bool, ) -> PResult<'a, AsmArgs> { - let dcx = &p.sess.dcx; + let dcx = &p.psess.dcx; if p.token == token::Eof { return Err(dcx.create_err(errors::AsmRequiresTemplate { span: sp })); @@ -296,7 +296,7 @@ pub fn parse_asm_args<'a>( fn err_duplicate_option(p: &mut Parser<'_>, symbol: Symbol, span: Span) { // Tool-only output let full_span = if p.token.kind == token::Comma { span.to(p.token.span) } else { span }; - p.sess.dcx.emit_err(errors::AsmOptAlreadyprovided { span, symbol, full_span }); + p.psess.dcx.emit_err(errors::AsmOptAlreadyprovided { span, symbol, full_span }); } /// Try to set the provided option in the provided `AsmArgs`. @@ -368,7 +368,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a, p.expect(&token::OpenDelim(Delimiter::Parenthesis))?; if p.eat(&token::CloseDelim(Delimiter::Parenthesis)) { - return Err(p.sess.dcx.create_err(errors::NonABI { span: p.token.span })); + return Err(p.psess.dcx.create_err(errors::NonABI { span: p.token.span })); } let mut new_abis = Vec::new(); @@ -379,7 +379,7 @@ fn parse_clobber_abi<'a>(p: &mut Parser<'a>, args: &mut AsmArgs) -> PResult<'a, } Err(opt_lit) => { let span = opt_lit.map_or(p.token.span, |lit| lit.span); - let mut err = p.sess.dcx.struct_span_err(span, "expected string literal"); + let mut err = p.psess.dcx.struct_span_err(span, "expected string literal"); err.span_label(span, "not a string literal"); return Err(err); } @@ -495,7 +495,7 @@ fn expand_preparsed_asm( }; if template_str.contains(".intel_syntax") { - ecx.parse_sess().buffer_lint( + ecx.psess().buffer_lint( lint::builtin::BAD_ASM_STYLE, find_span(".intel_syntax"), ecx.current_expansion.lint_node_id, @@ -503,7 +503,7 @@ fn expand_preparsed_asm( ); } if template_str.contains(".att_syntax") { - ecx.parse_sess().buffer_lint( + ecx.psess().buffer_lint( lint::builtin::BAD_ASM_STYLE, find_span(".att_syntax"), ecx.current_expansion.lint_node_id, |
