@@ -870,6 +870,7 @@ impl Token {
870
870
/// Is this a pre-parsed expression dropped into the token stream
871
871
/// (which happens while parsing the result of macro expansion)?
872
872
pub fn is_whole_expr ( & self ) -> bool {
873
+ #[ allow( irrefutable_let_patterns) ] // FIXME: temporary
873
874
if let Interpolated ( nt) = & self . kind
874
875
&& let NtExpr ( _) | NtLiteral ( _) | NtBlock ( _) = & * * nt
875
876
{
@@ -1103,9 +1104,7 @@ pub enum NtExprKind {
1103
1104
#[ derive( Clone , Encodable , Decodable ) ]
1104
1105
/// For interpolation during macro expansion.
1105
1106
pub enum Nonterminal {
1106
- NtItem ( P < ast:: Item > ) ,
1107
1107
NtBlock ( P < ast:: Block > ) ,
1108
- NtStmt ( P < ast:: Stmt > ) ,
1109
1108
NtExpr ( P < ast:: Expr > ) ,
1110
1109
NtLiteral ( P < ast:: Expr > ) ,
1111
1110
}
@@ -1196,18 +1195,14 @@ impl fmt::Display for NonterminalKind {
1196
1195
impl Nonterminal {
1197
1196
pub fn use_span ( & self ) -> Span {
1198
1197
match self {
1199
- NtItem ( item) => item. span ,
1200
1198
NtBlock ( block) => block. span ,
1201
- NtStmt ( stmt) => stmt. span ,
1202
1199
NtExpr ( expr) | NtLiteral ( expr) => expr. span ,
1203
1200
}
1204
1201
}
1205
1202
1206
1203
pub fn descr ( & self ) -> & ' static str {
1207
1204
match self {
1208
- NtItem ( ..) => "item" ,
1209
1205
NtBlock ( ..) => "block" ,
1210
- NtStmt ( ..) => "statement" ,
1211
1206
NtExpr ( ..) => "expression" ,
1212
1207
NtLiteral ( ..) => "literal" ,
1213
1208
}
@@ -1227,9 +1222,7 @@ impl PartialEq for Nonterminal {
1227
1222
impl fmt:: Debug for Nonterminal {
1228
1223
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
1229
1224
match * self {
1230
- NtItem ( ..) => f. pad ( "NtItem(..)" ) ,
1231
1225
NtBlock ( ..) => f. pad ( "NtBlock(..)" ) ,
1232
- NtStmt ( ..) => f. pad ( "NtStmt(..)" ) ,
1233
1226
NtExpr ( ..) => f. pad ( "NtExpr(..)" ) ,
1234
1227
NtLiteral ( ..) => f. pad ( "NtLiteral(..)" ) ,
1235
1228
}
0 commit comments