1
Fork 0

Rollup merge of #80784 - petrochenkov:nontspan, r=Aaron1011

rustc_parse: Better spans for synthesized token streams

I think using the nonterminal span for synthesizing its tokens is a better approximation than using `DUMMY_SP` or the attribute span like #79472 did in `expand.rs`.

r? `@Aaron1011`
This commit is contained in:
Yuki Okushi 2021-01-08 02:06:20 +09:00 committed by GitHub
commit 695f878332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 151 additions and 167 deletions

View file

@ -771,7 +771,7 @@ impl fmt::Display for NonterminalKind {
}
impl Nonterminal {
fn span(&self) -> Span {
pub fn span(&self) -> Span {
match self {
NtItem(item) => item.span,
NtBlock(block) => block.span,