From 7374fdcf541ff92449112a539345e48a27edc45e Mon Sep 17 00:00:00 2001 From: topecongiro Date: Tue, 19 Dec 2017 17:54:39 +0900 Subject: [PATCH 1/2] Remove a token after closing delimiter from the span of macro in type position --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index c3dd17e877566..74ec11b83c78a 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` From e0e62fccd2572f80903e4e6b80891dfdb9242605 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Wed, 20 Dec 2017 01:21:40 +0900 Subject: [PATCH 2/2] Fix up an ui test --- src/test/ui/issue-32950.stderr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/test/ui/issue-32950.stderr b/src/test/ui/issue-32950.stderr index 0933c81d65560..abfa03f4d581a 100644 --- a/src/test/ui/issue-32950.stderr +++ b/src/test/ui/issue-32950.stderr @@ -1,9 +1,8 @@ error: `derive` cannot be used on items with type macros --> $DIR/issue-32950.rs:15:5 | -15 | / concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros -16 | | ); - | |_^ +15 | concat_idents!(Foo, Bar) //~ ERROR `derive` cannot be used on items with type macros + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error