Rename ast::StmtKind::Local
into ast::StmtKind::Let
This commit is contained in:
parent
6f3eb1ce3d
commit
ca9f0630a9
17 changed files with 24 additions and 24 deletions
|
@ -1021,7 +1021,7 @@ impl Stmt {
|
|||
#[derive(Clone, Encodable, Decodable, Debug)]
|
||||
pub enum StmtKind {
|
||||
/// A local (let) binding.
|
||||
Local(P<Local>),
|
||||
Let(P<Local>),
|
||||
/// An item definition.
|
||||
Item(P<Item>),
|
||||
/// Expr without trailing semi-colon.
|
||||
|
|
|
@ -182,7 +182,7 @@ impl<T: HasTokens> HasTokens for Option<T> {
|
|||
impl HasTokens for StmtKind {
|
||||
fn tokens(&self) -> Option<&LazyAttrTokenStream> {
|
||||
match self {
|
||||
StmtKind::Local(local) => local.tokens.as_ref(),
|
||||
StmtKind::Let(local) => local.tokens.as_ref(),
|
||||
StmtKind::Item(item) => item.tokens(),
|
||||
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.tokens(),
|
||||
StmtKind::Empty => return None,
|
||||
|
@ -191,7 +191,7 @@ impl HasTokens for StmtKind {
|
|||
}
|
||||
fn tokens_mut(&mut self) -> Option<&mut Option<LazyAttrTokenStream>> {
|
||||
match self {
|
||||
StmtKind::Local(local) => Some(&mut local.tokens),
|
||||
StmtKind::Let(local) => Some(&mut local.tokens),
|
||||
StmtKind::Item(item) => item.tokens_mut(),
|
||||
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.tokens_mut(),
|
||||
StmtKind::Empty => return None,
|
||||
|
@ -355,7 +355,7 @@ impl HasAttrs for StmtKind {
|
|||
|
||||
fn attrs(&self) -> &[Attribute] {
|
||||
match self {
|
||||
StmtKind::Local(local) => &local.attrs,
|
||||
StmtKind::Let(local) => &local.attrs,
|
||||
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.attrs(),
|
||||
StmtKind::Item(item) => item.attrs(),
|
||||
StmtKind::Empty => &[],
|
||||
|
@ -365,7 +365,7 @@ impl HasAttrs for StmtKind {
|
|||
|
||||
fn visit_attrs(&mut self, f: impl FnOnce(&mut AttrVec)) {
|
||||
match self {
|
||||
StmtKind::Local(local) => f(&mut local.attrs),
|
||||
StmtKind::Let(local) => f(&mut local.attrs),
|
||||
StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr.visit_attrs(f),
|
||||
StmtKind::Item(item) => item.visit_attrs(f),
|
||||
StmtKind::Empty => {}
|
||||
|
|
|
@ -1567,7 +1567,7 @@ pub fn noop_flat_map_stmt_kind<T: MutVisitor>(
|
|||
vis: &mut T,
|
||||
) -> SmallVec<[StmtKind; 1]> {
|
||||
match kind {
|
||||
StmtKind::Local(mut local) => smallvec![StmtKind::Local({
|
||||
StmtKind::Let(mut local) => smallvec![StmtKind::Let({
|
||||
vis.visit_local(&mut local);
|
||||
local
|
||||
})],
|
||||
|
|
|
@ -787,7 +787,7 @@ pub fn walk_block<'a, V: Visitor<'a>>(visitor: &mut V, block: &'a Block) -> V::R
|
|||
|
||||
pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) -> V::Result {
|
||||
match &statement.kind {
|
||||
StmtKind::Local(local) => try_visit!(visitor.visit_local(local)),
|
||||
StmtKind::Let(local) => try_visit!(visitor.visit_local(local)),
|
||||
StmtKind::Item(item) => try_visit!(visitor.visit_item(item)),
|
||||
StmtKind::Expr(expr) | StmtKind::Semi(expr) => try_visit!(visitor.visit_expr(expr)),
|
||||
StmtKind::Empty => {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue