1
Fork 0

Rename hir::Local into hir::LetStmt

This commit is contained in:
Guillaume Gomez 2024-03-20 17:50:31 +01:00
parent b3df0d7e5e
commit b376f49e30
60 changed files with 132 additions and 132 deletions

View file

@ -2140,7 +2140,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
// the same span as the error and the type is specified.
if let hir::Stmt {
kind:
hir::StmtKind::Let(hir::Local {
hir::StmtKind::Let(hir::LetStmt {
init: Some(hir::Expr { span: init_span, .. }),
ty: Some(array_ty),
..

View file

@ -11,7 +11,7 @@ use rustc_hir::def::Res;
use rustc_hir::def::{CtorOf, DefKind, Namespace};
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{Body, Closure, Expr, ExprKind, FnRetTy, HirId, Local, LocalSource};
use rustc_hir::{Body, Closure, Expr, ExprKind, FnRetTy, HirId, LetStmt, LocalSource};
use rustc_middle::hir::nested_filter;
use rustc_middle::infer::unify_key::{
ConstVariableOrigin, ConstVariableOriginKind, ConstVariableValue,
@ -1122,7 +1122,7 @@ impl<'a, 'tcx> Visitor<'tcx> for FindInferSourceVisitor<'a, 'tcx> {
self.tecx.tcx.hir()
}
fn visit_local(&mut self, local: &'tcx Local<'tcx>) {
fn visit_local(&mut self, local: &'tcx LetStmt<'tcx>) {
intravisit::walk_local(self, local);
if let Some(ty) = self.opt_node_type(local.hir_id) {

View file

@ -2,7 +2,7 @@ use crate::infer::error_reporting::hir::Path;
use core::ops::ControlFlow;
use hir::def::CtorKind;
use hir::intravisit::{walk_expr, walk_stmt, Visitor};
use hir::{Local, QPath};
use hir::{LetStmt, QPath};
use rustc_data_structures::fx::FxIndexSet;
use rustc_errors::{Applicability, Diag};
use rustc_hir as hir;
@ -321,7 +321,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
&& let Some(expr) = block.expr
&& let hir::ExprKind::Path(QPath::Resolved(_, Path { res, .. })) = expr.kind
&& let Res::Local(local) = res
&& let Node::Local(Local { init: Some(init), .. }) = self.tcx.parent_hir_node(*local)
&& let Node::Local(LetStmt { init: Some(init), .. }) = self.tcx.parent_hir_node(*local)
{
fn collect_blocks<'hir>(expr: &hir::Expr<'hir>, blocks: &mut Vec<&hir::Block<'hir>>) {
match expr.kind {
@ -585,7 +585,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
}
fn visit_stmt(&mut self, ex: &'v hir::Stmt<'v>) -> Self::Result {
if let hir::StmtKind::Let(hir::Local {
if let hir::StmtKind::Let(LetStmt {
span,
pat: hir::Pat { .. },
ty: None,