1
Fork 0

Prefer dcx methods over fields or fields' methods

This commit is contained in:
Oli Scherer 2024-06-18 09:43:28 +00:00
parent 7e5893019c
commit c91edc3888
24 changed files with 62 additions and 58 deletions

View file

@ -41,7 +41,7 @@ impl AttrWrapper {
}
pub(crate) fn take_for_recovery(self, psess: &ParseSess) -> AttrVec {
psess.dcx.span_delayed_bug(
psess.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

@ -241,7 +241,7 @@ impl<'a> DerefMut for SnapshotParser<'a> {
impl<'a> Parser<'a> {
pub fn dcx(&self) -> &'a DiagCtxt {
&self.psess.dcx
self.psess.dcx()
}
/// Replace `self` with `snapshot.parser`.

View file

@ -1596,7 +1596,7 @@ pub(crate) fn make_unclosed_delims_error(
if let Some(sp) = unmatched.unclosed_span {
spans.push(sp);
};
let err = psess.dcx.create_err(MismatchedClosingDelimiter {
let err = psess.dcx().create_err(MismatchedClosingDelimiter {
spans,
delimiter: pprust::token_kind_to_string(&token::CloseDelim(found_delim)).to_string(),
unmatched: unmatched.found_span,