diff options
| author | kennytm <kennytm@gmail.com> | 2017-12-20 21:22:00 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-12-20 21:22:00 +0800 |
| commit | 99fdca077c9e4b629dbb44453804ca0e449f0e56 (patch) | |
| tree | 74e5783462a6b2874e23f48a40996d1d164aa24c /src/libsyntax/parse | |
| parent | 16095b3601a16262df8d96863b6235cba23a3f96 (diff) | |
| parent | e0e62fccd2572f80903e4e6b80891dfdb9242605 (diff) | |
| download | rust-99fdca077c9e4b629dbb44453804ca0e449f0e56.tar.gz rust-99fdca077c9e4b629dbb44453804ca0e449f0e56.zip | |
Rollup merge of #46835 - topecongiro:bad-span-for-macro-invocation-in-type, r=petrochenkov
Remove a token after closing delimiter from the span of macro in type position e.g. ```rust let x = y: foo!(); ``` The span for `foo!()` includes `;`. cc https://github.com/rust-lang-nursery/rustfmt/issues/2290.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c3dd17e8775..74ec11b83c7 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1553,7 +1553,7 @@ impl<'a> Parser<'a> { if self.eat(&token::Not) { // Macro invocation in type position let (_, tts) = self.expect_delimited_token_tree()?; - TyKind::Mac(respan(lo.to(self.span), Mac_ { path: path, tts: tts })) + TyKind::Mac(respan(lo.to(self.prev_span), Mac_ { path: path, tts: tts })) } else { // Just a type path or bound list (trait object type) starting with a trait. // `Type` |
