diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-07 13:31:13 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-06-07 13:51:23 +0300 |
| commit | 3da094319c705e123e1176553d9c5b5955ff0642 (patch) | |
| tree | fc645ebe08cf422453dd606cb58c445c95ed4ae8 /src/libsyntax_ext | |
| parent | ca1bcfdde3f19afd68ef808cecf2ce56d08d5df4 (diff) | |
| download | rust-3da094319c705e123e1176553d9c5b5955ff0642.tar.gz rust-3da094319c705e123e1176553d9c5b5955ff0642.zip | |
parser: `self.span` -> `self.token.span`
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", )); }; |
