rustc_ast: Replace AstLike::finalize_tokens with a getter tokens_mut

This commit is contained in:
Vadim Petrochenkov
2021-03-06 21:06:01 +03:00
parent 51748a8fc7
commit 069e612e73
5 changed files with 60 additions and 78 deletions

View File

@@ -915,16 +915,6 @@ impl Stmt {
}
}
pub fn tokens_mut(&mut self) -> Option<&mut LazyTokenStream> {
match self.kind {
StmtKind::Local(ref mut local) => local.tokens.as_mut(),
StmtKind::Item(ref mut item) => item.tokens.as_mut(),
StmtKind::Expr(ref mut expr) | StmtKind::Semi(ref mut expr) => expr.tokens.as_mut(),
StmtKind::Empty => None,
StmtKind::MacCall(ref mut mac) => mac.tokens.as_mut(),
}
}
pub fn has_trailing_semicolon(&self) -> bool {
match &self.kind {
StmtKind::Semi(_) => true,