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_parse/src/parser/path.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_parse/src/parser/path.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 6e7bbe7e06d..545db5138a3 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -250,7 +250,7 @@ impl<'a> Parser<'a> { self.dcx().emit_err(PathSingleColon { span: self.prev_token.span, type_ascription: self - .sess + .psess .unstable_features .is_nightly_build() .then_some(()), @@ -322,7 +322,7 @@ impl<'a> Parser<'a> { err = self.dcx().create_err(PathSingleColon { span: self.token.span, type_ascription: self - .sess + .psess .unstable_features .is_nightly_build() .then_some(()), @@ -638,9 +638,9 @@ impl<'a> Parser<'a> { && args.inputs.is_empty() && matches!(args.output, ast::FnRetTy::Default(..)) { - self.sess.gated_spans.gate(sym::return_type_notation, span); + self.psess.gated_spans.gate(sym::return_type_notation, span); } else { - self.sess.gated_spans.gate(sym::associated_type_bounds, span); + self.psess.gated_spans.gate(sym::associated_type_bounds, span); } } let constraint = @@ -675,7 +675,7 @@ impl<'a> Parser<'a> { let term = match arg { Some(GenericArg::Type(ty)) => ty.into(), Some(GenericArg::Const(c)) => { - self.sess.gated_spans.gate(sym::associated_const_equality, span); + self.psess.gated_spans.gate(sym::associated_const_equality, span); c.into() } Some(GenericArg::Lifetime(lt)) => { @@ -691,7 +691,7 @@ impl<'a> Parser<'a> { .struct_span_err(after_eq.to(before_next), "missing type to the right of `=`"); if matches!(self.token.kind, token::Comma | token::Gt) { err.span_suggestion( - self.sess.source_map().next_point(eq).to(before_next), + self.psess.source_map().next_point(eq).to(before_next), "to constrain the associated type, add a type after `=`", " TheType", Applicability::HasPlaceholders, |
