1
Fork 0

Rename hir::StmtKind::Local into hir::StmtKind::Let

This commit is contained in:
Guillaume Gomez 2024-03-14 11:53:38 +01:00
parent ca9f0630a9
commit a4e0e50a3f
58 changed files with 76 additions and 76 deletions

View file

@ -27,7 +27,7 @@ pub fn maybe_expr_static_mut(tcx: TyCtxt<'_>, expr: hir::Expr<'_>) {
/// Check for shared or mutable references of `static mut` inside statement
pub fn maybe_stmt_static_mut(tcx: TyCtxt<'_>, stmt: hir::Stmt<'_>) {
if let hir::StmtKind::Local(loc) = stmt.kind
if let hir::StmtKind::Let(loc) = stmt.kind
&& let hir::PatKind::Binding(ba, _, _, _) = loc.pat.kind
&& matches!(ba.0, rustc_ast::ByRef::Yes)
&& let Some(init) = loc.init