about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-03-14 11:25:05 +0100
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-03-14 12:42:04 +0100
commitfe0415e17a6cda89ab7a8afa3cfe1dfc298e3ded (patch)
treeca08fee9c48667b27c924e1180b05471f872da94
parent5f8d353fe1ea01df5b7dcbf73190b5528568eb94 (diff)
downloadrust-fe0415e17a6cda89ab7a8afa3cfe1dfc298e3ded.tar.gz
rust-fe0415e17a6cda89ab7a8afa3cfe1dfc298e3ded.zip
Rename `ast::StmtKind::Local` into `ast::StmtKind::Let`
-rw-r--r--src/attr.rs2
-rw-r--r--src/spanned.rs2
-rw-r--r--src/stmt.rs2
-rw-r--r--src/visitor.rs2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/attr.rs b/src/attr.rs
index 4d83547d664..83f59837d44 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -26,7 +26,7 @@ pub(crate) fn get_attrs_from_stmt(stmt: &ast::Stmt) -> &[ast::Attribute] {
 
 pub(crate) fn get_span_without_attrs(stmt: &ast::Stmt) -> Span {
     match stmt.kind {
-        ast::StmtKind::Local(ref local) => local.span,
+        ast::StmtKind::Let(ref local) => local.span,
         ast::StmtKind::Item(ref item) => item.span,
         ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => expr.span,
         ast::StmtKind::MacCall(ref mac_stmt) => mac_stmt.mac.span(),
diff --git a/src/spanned.rs b/src/spanned.rs
index 5960b144499..4aaf7fdb27f 100644
--- a/src/spanned.rs
+++ b/src/spanned.rs
@@ -61,7 +61,7 @@ implement_spanned!(ast::Local);
 impl Spanned for ast::Stmt {
     fn span(&self) -> Span {
         match self.kind {
-            ast::StmtKind::Local(ref local) => mk_sp(local.span().lo(), self.span.hi()),
+            ast::StmtKind::Let(ref local) => mk_sp(local.span().lo(), self.span.hi()),
             ast::StmtKind::Item(ref item) => mk_sp(item.span().lo(), self.span.hi()),
             ast::StmtKind::Expr(ref expr) | ast::StmtKind::Semi(ref expr) => {
                 mk_sp(expr.span().lo(), self.span.hi())
diff --git a/src/stmt.rs b/src/stmt.rs
index e3fe4ebca11..73a9cce416c 100644
--- a/src/stmt.rs
+++ b/src/stmt.rs
@@ -115,7 +115,7 @@ fn format_stmt(
     skip_out_of_file_lines_range!(context, stmt.span());
 
     let result = match stmt.kind {
-        ast::StmtKind::Local(ref local) => local.rewrite(context, shape),
+        ast::StmtKind::Let(ref local) => local.rewrite(context, shape),
         ast::StmtKind::Expr(ref ex) | ast::StmtKind::Semi(ref ex) => {
             let suffix = if semicolon_for_stmt(context, stmt, is_last_expr) {
                 ";"
diff --git a/src/visitor.rs b/src/visitor.rs
index 47f772b485d..6209b37004b 100644
--- a/src/visitor.rs
+++ b/src/visitor.rs
@@ -150,7 +150,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
                 self.visit_item(item);
                 self.last_pos = stmt.span().hi();
             }
-            ast::StmtKind::Local(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
+            ast::StmtKind::Let(..) | ast::StmtKind::Expr(..) | ast::StmtKind::Semi(..) => {
                 let attrs = get_attrs_from_stmt(stmt.as_ast_node());
                 if contains_skip(attrs) {
                     self.push_skipped_with_span(