diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-08 03:33:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-08 03:33:57 +0200 |
| commit | ae487e04c89fe5295ed674cf08f0a86123304572 (patch) | |
| tree | 264bad3e19ee32f5f2e352987dbe61296c1abae0 /src/libsyntax_ext | |
| parent | 5062ad3c60367abb4566885a3276b9305edcf614 (diff) | |
| parent | 3dbee57daee312ee073006101053f5e3934de7c6 (diff) | |
| download | rust-ae487e04c89fe5295ed674cf08f0a86123304572.tar.gz rust-ae487e04c89fe5295ed674cf08f0a86123304572.zip | |
Rollup merge of #61616 - petrochenkov:parsderef, r=oli-obk
parser: Remove `Deref` impl from `Parser` Follow up to https://github.com/rust-lang/rust/pull/61541 You have to write `self.token.span` instead of `self.span` in the parser now, which is not nice, but not too bad either, I guess. Not sure. Probably still better than people using both and being confused about the definition point of `span`. r? @oli-obk @estebank
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/assert.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/format.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index 3886528c74c..10d323ffb89 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -85,7 +85,7 @@ fn parse_assert<'a>( if parser.token == token::Semi { let mut err = cx.struct_span_warn(sp, "macro requires an expression as an argument"); err.span_suggestion( - parser.span, + parser.token.span, "try removing semicolon", String::new(), Applicability::MaybeIncorrect @@ -105,7 +105,7 @@ fn parse_assert<'a>( // turned into an error. let custom_message = if let token::Literal(token::Lit { kind: token::Str, .. }) = parser.token.kind { - let mut err = cx.struct_span_warn(parser.span, "unexpected string literal"); + let mut err = cx.struct_span_warn(parser.token.span, "unexpected string literal"); let comma_span = cx.source_map().next_point(parser.prev_span); err.span_suggestion_short( comma_span, diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index c78215b77a9..377164728f4 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -142,7 +142,7 @@ fn parse_args<'a>( while p.token != token::Eof { if !p.eat(&token::Comma) { - return Err(ecx.struct_span_err(p.span, "expected token: `,`")); + return Err(ecx.struct_span_err(p.token.span, "expected token: `,`")); } if p.token == token::Eof { break; @@ -154,7 +154,7 @@ fn parse_args<'a>( name } else { return Err(ecx.struct_span_err( - p.span, + p.token.span, "expected ident, positional arguments cannot follow named arguments", )); }; |
