Use Session::diagnostic
in more places.
This commit is contained in:
parent
a179a53565
commit
31ac4efb31
7 changed files with 33 additions and 40 deletions
|
@ -115,7 +115,7 @@ impl<'a> Parser<'a> {
|
|||
Some(item) => NtItem(item),
|
||||
None => {
|
||||
return Err(UnexpectedNonterminal::Item(self.token.span)
|
||||
.into_diagnostic(&self.sess.span_diagnostic));
|
||||
.into_diagnostic(self.diagnostic()));
|
||||
}
|
||||
},
|
||||
NonterminalKind::Block => {
|
||||
|
@ -127,7 +127,7 @@ impl<'a> Parser<'a> {
|
|||
Some(s) => NtStmt(P(s)),
|
||||
None => {
|
||||
return Err(UnexpectedNonterminal::Statement(self.token.span)
|
||||
.into_diagnostic(&self.sess.span_diagnostic));
|
||||
.into_diagnostic(self.diagnostic()));
|
||||
}
|
||||
},
|
||||
NonterminalKind::PatParam { .. } | NonterminalKind::PatWithOr => {
|
||||
|
@ -163,7 +163,7 @@ impl<'a> Parser<'a> {
|
|||
span: self.token.span,
|
||||
token: self.token.clone(),
|
||||
}
|
||||
.into_diagnostic(&self.sess.span_diagnostic));
|
||||
.into_diagnostic(self.diagnostic()));
|
||||
}
|
||||
NonterminalKind::Path => {
|
||||
NtPath(P(self.collect_tokens_no_attrs(|this| this.parse_path(PathStyle::Type))?))
|
||||
|
@ -181,7 +181,7 @@ impl<'a> Parser<'a> {
|
|||
span: self.token.span,
|
||||
token: self.token.clone(),
|
||||
}
|
||||
.into_diagnostic(&self.sess.span_diagnostic));
|
||||
.into_diagnostic(self.diagnostic()));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue