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`.
This commit is contained in:
Nicholas Nethercote 2024-03-04 16:31:49 +11:00
parent 4260f7ec67
commit 80d2bdb619
98 changed files with 653 additions and 687 deletions

View file

@ -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,