From 5d06c890fececc6f6779cd65ca83cef4647b8fdd Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 8 Mar 2018 14:27:23 +0300 Subject: syntax: Make `_` an identifier --- src/libsyntax/ext/quote.rs | 1 - src/libsyntax/ext/tt/macro_parser.rs | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/libsyntax/ext') diff --git a/src/libsyntax/ext/quote.rs b/src/libsyntax/ext/quote.rs index 7a024dbad88..d6642b7b6c2 100644 --- a/src/libsyntax/ext/quote.rs +++ b/src/libsyntax/ext/quote.rs @@ -709,7 +709,6 @@ fn expr_mk_token(cx: &ExtCtxt, sp: Span, tok: &token::Token) -> P { token::Pound => "Pound", token::Dollar => "Dollar", token::Question => "Question", - token::Underscore => "Underscore", token::Eof => "Eof", token::Whitespace | token::Comment | token::Shebang(_) => { diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs index 0621f728e2a..beefdb3a6ea 100644 --- a/src/libsyntax/ext/tt/macro_parser.rs +++ b/src/libsyntax/ext/tt/macro_parser.rs @@ -765,8 +765,7 @@ fn may_begin_with(name: &str, token: &Token) -> bool { Token::DotDotDot | // range pattern (future compat) Token::ModSep | // path Token::Lt | // path (UFCS constant) - Token::BinOp(token::Shl) | // path (double UFCS) - Token::Underscore => true, // placeholder + Token::BinOp(token::Shl) => true, // path (double UFCS) Token::Interpolated(ref nt) => may_be_ident(&nt.0), _ => false, }, -- cgit 1.4.1-3-g733a5