@@ -870,6 +870,7 @@ impl Token {
870870/// Is this a pre-parsed expression dropped into the token stream
871871/// (which happens while parsing the result of macro expansion)?
872872pub fn is_whole_expr ( & self ) -> bool {
873+ #[ allow( irrefutable_let_patterns) ] // FIXME: temporary
873874if let Interpolated ( nt) = & self . kind
874875 && let NtExpr ( _) | NtLiteral ( _) | NtBlock ( _) = & * * nt
875876{
@@ -1103,9 +1104,7 @@ pub enum NtExprKind {
11031104#[ derive( Clone , Encodable , Decodable ) ]
11041105/// For interpolation during macro expansion.
11051106pub enum Nonterminal {
1106- NtItem ( P < ast:: Item > ) ,
11071107NtBlock ( P < ast:: Block > ) ,
1108- NtStmt ( P < ast:: Stmt > ) ,
11091108NtExpr ( P < ast:: Expr > ) ,
11101109NtLiteral ( P < ast:: Expr > ) ,
11111110}
@@ -1196,18 +1195,14 @@ impl fmt::Display for NonterminalKind {
11961195impl Nonterminal {
11971196pub fn use_span ( & self ) -> Span {
11981197match self {
1199- NtItem ( item) => item. span ,
12001198NtBlock ( block) => block. span ,
1201- NtStmt ( stmt) => stmt. span ,
12021199NtExpr ( expr) | NtLiteral ( expr) => expr. span ,
12031200}
12041201}
12051202
12061203pub fn descr ( & self ) -> & ' static str {
12071204match self {
1208- NtItem ( ..) => "item" ,
12091205NtBlock ( ..) => "block" ,
1210- NtStmt ( ..) => "statement" ,
12111206NtExpr ( ..) => "expression" ,
12121207NtLiteral ( ..) => "literal" ,
12131208}
@@ -1227,9 +1222,7 @@ impl PartialEq for Nonterminal {
12271222impl fmt:: Debug for Nonterminal {
12281223fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
12291224match * self {
1230- NtItem ( ..) => f. pad ( "NtItem(..)" ) ,
12311225NtBlock ( ..) => f. pad ( "NtBlock(..)" ) ,
1232- NtStmt ( ..) => f. pad ( "NtStmt(..)" ) ,
12331226NtExpr ( ..) => f. pad ( "NtExpr(..)" ) ,
12341227NtLiteral ( ..) => f. pad ( "NtLiteral(..)" ) ,
12351228}
0 commit comments