Rename ParseSess::span_diagnostic as ParseSess::dcx.

This commit is contained in:
Nicholas Nethercote
2023-12-17 22:25:47 +11:00
parent 9b1f87c7e8
commit 9df1576e1d
26 changed files with 89 additions and 98 deletions

View File

@@ -41,7 +41,7 @@ impl AttrWrapper {
}
pub(crate) fn take_for_recovery(self, sess: &ParseSess) -> AttrVec {
sess.span_diagnostic.span_delayed_bug(
sess.dcx.span_delayed_bug(
self.attrs.get(0).map(|attr| attr.span).unwrap_or(DUMMY_SP),
"AttrVec is taken for recovery but no error is produced",
);

View File

@@ -254,7 +254,7 @@ impl<'a> Parser<'a> {
}
pub(super) fn diagnostic(&self) -> &'a DiagCtxt {
&self.sess.span_diagnostic
&self.sess.dcx
}
/// Replace `self` with `snapshot.parser`.

View File

@@ -3537,7 +3537,7 @@ impl<'a> Parser<'a> {
ident_span: this.token.span,
token: this.look_ahead(1, |t| t.clone()),
}
.into_diagnostic(&self.sess.span_diagnostic));
.into_diagnostic(&self.sess.dcx));
}
let (ident, expr) = if is_shorthand {
// Mimic `x: x` for the `x` field shorthand.

View File

@@ -1507,7 +1507,7 @@ pub(crate) fn make_unclosed_delims_error(
opening_candidate: unmatched.candidate_span,
unclosed: unmatched.unclosed_span,
}
.into_diagnostic(&sess.span_diagnostic);
.into_diagnostic(&sess.dcx);
Some(err)
}