Skip to content

Commit b376f49

Browse files
Rename hir::Local into hir::LetStmt
1 parent b3df0d7 commit b376f49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+132
-132
lines changed

compiler/rustc_ast_lowering/src/block.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
8181
(self.arena.alloc_from_iter(stmts), expr)
8282
}
8383

84-
fn lower_local(&mut self, l: &Local) -> &'hir hir::Local<'hir> {
84+
fn lower_local(&mut self, l: &Local) -> &'hir hir::LetStmt<'hir> {
8585
let ty = l
8686
.ty
8787
.as_ref()
@@ -97,7 +97,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
9797
let span = self.lower_span(l.span);
9898
let source = hir::LocalSource::Normal;
9999
self.lower_attrs(hir_id, &l.attrs);
100-
self.arena.alloc(hir::Local { hir_id, ty, pat, init, els, span, source })
100+
self.arena.alloc(hir::LetStmt { hir_id, ty, pat, init, els, span, source })
101101
}
102102

103103
fn lower_block_check_mode(&mut self, b: &BlockCheckMode) -> hir::BlockCheckMode {

compiler/rustc_ast_lowering/src/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
302302
});
303303
}
304304

305-
fn visit_local(&mut self, l: &'hir Local<'hir>) {
305+
fn visit_local(&mut self, l: &'hir LetStmt<'hir>) {
306306
self.insert(l.span, l.hir_id, Node::Local(l));
307307
self.with_parent(l.hir_id, |this| {
308308
intravisit::walk_local(this, l);

compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
23412341
debug_assert!(!a.is_empty());
23422342
self.attrs.insert(hir_id.local_id, a);
23432343
}
2344-
let local = hir::Local {
2344+
let local = hir::LetStmt {
23452345
hir_id,
23462346
init,
23472347
pat,

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
622622

623623
// FIXME: We make sure that this is a normal top-level binding,
624624
// but we could suggest `todo!()` for all uninitalized bindings in the pattern pattern
625-
if let hir::StmtKind::Let(hir::Local { span, ty, init: None, pat, .. }) =
625+
if let hir::StmtKind::Let(hir::LetStmt { span, ty, init: None, pat, .. }) =
626626
&ex.kind
627627
&& let hir::PatKind::Binding(..) = pat.kind
628628
&& span.contains(self.decl_span)
@@ -800,7 +800,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
800800
for (_, node) in tcx.hir().parent_iter(expr.hir_id) {
801801
let e = match node {
802802
hir::Node::Expr(e) => e,
803-
hir::Node::Local(hir::Local { els: Some(els), .. }) => {
803+
hir::Node::Local(hir::LetStmt { els: Some(els), .. }) => {
804804
let mut finder = BreakFinder { found_breaks: vec![], found_continues: vec![] };
805805
finder.visit_block(els);
806806
if !finder.found_breaks.is_empty() {
@@ -2124,7 +2124,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21242124
hir::intravisit::walk_expr(self, e);
21252125
}
21262126

2127-
fn visit_local(&mut self, local: &'hir hir::Local<'hir>) {
2127+
fn visit_local(&mut self, local: &'hir hir::LetStmt<'hir>) {
21282128
if let hir::Pat { kind: hir::PatKind::Binding(_, hir_id, _ident, _), .. } =
21292129
local.pat
21302130
&& let Some(init) = local.init

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
558558
hir::intravisit::walk_stmt(self, stmt);
559559
let expr = match stmt.kind {
560560
hir::StmtKind::Semi(expr) | hir::StmtKind::Expr(expr) => expr,
561-
hir::StmtKind::Let(hir::Local { init: Some(expr), .. }) => expr,
561+
hir::StmtKind::Let(hir::LetStmt { init: Some(expr), .. }) => expr,
562562
_ => {
563563
return;
564564
}
@@ -737,7 +737,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
737737
&& let body = self.infcx.tcx.hir().body(body_id)
738738
&& let Some(hir_id) = (BindingFinder { span: pat_span }).visit_body(body).break_value()
739739
&& let node = self.infcx.tcx.hir_node(hir_id)
740-
&& let hir::Node::Local(hir::Local {
740+
&& let hir::Node::Local(hir::LetStmt {
741741
pat: hir::Pat { kind: hir::PatKind::Ref(_, _), .. },
742742
..
743743
})

compiler/rustc_hir/src/hir.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ pub struct Stmt<'hir> {
12201220
#[derive(Debug, Clone, Copy, HashStable_Generic)]
12211221
pub enum StmtKind<'hir> {
12221222
/// A local (`let`) binding.
1223-
Let(&'hir Local<'hir>),
1223+
Let(&'hir LetStmt<'hir>),
12241224

12251225
/// An item binding.
12261226
Item(ItemId),
@@ -1234,7 +1234,7 @@ pub enum StmtKind<'hir> {
12341234

12351235
/// Represents a `let` statement (i.e., `let <pat>:<ty> = <init>;`).
12361236
#[derive(Debug, Clone, Copy, HashStable_Generic)]
1237-
pub struct Local<'hir> {
1237+
pub struct LetStmt<'hir> {
12381238
pub pat: &'hir Pat<'hir>,
12391239
/// Type annotation, if any (otherwise the type will be inferred).
12401240
pub ty: Option<&'hir Ty<'hir>>,
@@ -1264,7 +1264,7 @@ pub struct Arm<'hir> {
12641264
pub body: &'hir Expr<'hir>,
12651265
}
12661266

1267-
/// Represents a `let <pat>[: <ty>] = <expr>` expression (not a [`Local`]), occurring in an `if-let`
1267+
/// Represents a `let <pat>[: <ty>] = <expr>` expression (not a [`LetStmt`]), occurring in an `if-let`
12681268
/// or `let-else`, evaluating to a boolean. Typically the pattern is refutable.
12691269
///
12701270
/// In an `if let`, imagine it as `if (let <pat> = <expr>) { ... }`; in a let-else, it is part of
@@ -1861,7 +1861,7 @@ pub enum ExprKind<'hir> {
18611861
DropTemps(&'hir Expr<'hir>),
18621862
/// A `let $pat = $expr` expression.
18631863
///
1864-
/// These are not `Local` and only occur as expressions.
1864+
/// These are not [`LetStmt`] and only occur as expressions.
18651865
/// The `let Some(x) = foo()` in `if let Some(x) = foo()` is an example of `Let(..)`.
18661866
Let(&'hir LetExpr<'hir>),
18671867
/// An `if` block, with an optional else block.
@@ -3529,7 +3529,7 @@ pub enum Node<'hir> {
35293529
PatField(&'hir PatField<'hir>),
35303530
Arm(&'hir Arm<'hir>),
35313531
Block(&'hir Block<'hir>),
3532-
Local(&'hir Local<'hir>),
3532+
Local(&'hir LetStmt<'hir>),
35333533
/// `Ctor` refers to the constructor of an enum variant or struct. Only tuple or unit variants
35343534
/// with synthesized constructors.
35353535
Ctor(&'hir VariantData<'hir>),
@@ -3757,7 +3757,7 @@ impl<'hir> Node<'hir> {
37573757
expect_pat_field, &'hir PatField<'hir>, Node::PatField(n), n;
37583758
expect_arm, &'hir Arm<'hir>, Node::Arm(n), n;
37593759
expect_block, &'hir Block<'hir>, Node::Block(n), n;
3760-
expect_local, &'hir Local<'hir>, Node::Local(n), n;
3760+
expect_local, &'hir LetStmt<'hir>, Node::Local(n), n;
37613761
expect_ctor, &'hir VariantData<'hir>, Node::Ctor(n), n;
37623762
expect_lifetime, &'hir Lifetime, Node::Lifetime(n), n;
37633763
expect_generic_param, &'hir GenericParam<'hir>, Node::GenericParam(n), n;
@@ -3787,7 +3787,7 @@ mod size_asserts {
37873787
static_assert_size!(ImplItemKind<'_>, 40);
37883788
static_assert_size!(Item<'_>, 88);
37893789
static_assert_size!(ItemKind<'_>, 56);
3790-
static_assert_size!(Local<'_>, 64);
3790+
static_assert_size!(LetStmt<'_>, 64);
37913791
static_assert_size!(Param<'_>, 32);
37923792
static_assert_size!(Pat<'_>, 72);
37933793
static_assert_size!(Path<'_>, 40);

compiler/rustc_hir/src/intravisit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub trait Visitor<'v>: Sized {
320320
fn visit_foreign_item(&mut self, i: &'v ForeignItem<'v>) -> Self::Result {
321321
walk_foreign_item(self, i)
322322
}
323-
fn visit_local(&mut self, l: &'v Local<'v>) -> Self::Result {
323+
fn visit_local(&mut self, l: &'v LetStmt<'v>) -> Self::Result {
324324
walk_local(self, l)
325325
}
326326
fn visit_block(&mut self, b: &'v Block<'v>) -> Self::Result {
@@ -606,7 +606,7 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(
606606
V::Result::output()
607607
}
608608

609-
pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local<'v>) -> V::Result {
609+
pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v LetStmt<'v>) -> V::Result {
610610
// Intentionally visiting the expr first - the initialization expr
611611
// dominates the local's definition.
612612
visit_opt!(visitor, visit_expr, local.init);

compiler/rustc_hir_analysis/src/check/region.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_data_structures::fx::FxHashSet;
1111
use rustc_hir as hir;
1212
use rustc_hir::def_id::DefId;
1313
use rustc_hir::intravisit::{self, Visitor};
14-
use rustc_hir::{Arm, Block, Expr, Local, Pat, PatKind, Stmt};
14+
use rustc_hir::{Arm, Block, Expr, LetStmt, Pat, PatKind, Stmt};
1515
use rustc_index::Idx;
1616
use rustc_middle::middle::region::*;
1717
use rustc_middle::ty::TyCtxt;
@@ -123,7 +123,7 @@ fn resolve_block<'tcx>(visitor: &mut RegionResolutionVisitor<'tcx>, blk: &'tcx h
123123

124124
for (i, statement) in blk.stmts.iter().enumerate() {
125125
match statement.kind {
126-
hir::StmtKind::Let(hir::Local { els: Some(els), .. }) => {
126+
hir::StmtKind::Let(LetStmt { els: Some(els), .. }) => {
127127
// Let-else has a special lexical structure for variables.
128128
// First we take a checkpoint of the current scope context here.
129129
let mut prev_cx = visitor.cx;
@@ -855,7 +855,7 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
855855
fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) {
856856
resolve_expr(self, ex);
857857
}
858-
fn visit_local(&mut self, l: &'tcx Local<'tcx>) {
858+
fn visit_local(&mut self, l: &'tcx LetStmt<'tcx>) {
859859
resolve_local(self, Some(l.pat), l.init)
860860
}
861861
}

compiler/rustc_hir_pretty/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ impl<'a> State<'a> {
15441544
self.end()
15451545
}
15461546

1547-
fn print_local_decl(&mut self, loc: &hir::Local<'_>) {
1547+
fn print_local_decl(&mut self, loc: &hir::LetStmt<'_>) {
15481548
self.print_pat(loc.pat);
15491549
if let Some(ty) = loc.ty {
15501550
self.word_space(":");

compiler/rustc_hir_typeck/src/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
408408
}
409409
}
410410
}
411-
if let hir::Node::Local(hir::Local { ty: Some(_), pat, .. }) = node {
411+
if let hir::Node::Local(hir::LetStmt { ty: Some(_), pat, .. }) = node {
412412
return Some((pat.span, "expected because of this assignment".to_string()));
413413
}
414414
None

compiler/rustc_hir_typeck/src/demand.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
299299
return false;
300300
};
301301
let (init_ty_hir_id, init) = match self.tcx.parent_hir_node(pat.hir_id) {
302-
hir::Node::Local(hir::Local { ty: Some(ty), init, .. }) => (ty.hir_id, *init),
303-
hir::Node::Local(hir::Local { init: Some(init), .. }) => (init.hir_id, Some(*init)),
302+
hir::Node::Local(hir::LetStmt { ty: Some(ty), init, .. }) => (ty.hir_id, *init),
303+
hir::Node::Local(hir::LetStmt { init: Some(init), .. }) => (init.hir_id, Some(*init)),
304304
_ => return false,
305305
};
306306
let Some(init_ty) = self.node_ty_opt(init_ty_hir_id) else {
@@ -678,7 +678,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
678678
error: Option<TypeError<'tcx>>,
679679
) {
680680
match (self.tcx.parent_hir_node(expr.hir_id), error) {
681-
(hir::Node::Local(hir::Local { ty: Some(ty), init: Some(init), .. }), _)
681+
(hir::Node::Local(hir::LetStmt { ty: Some(ty), init: Some(init), .. }), _)
682682
if init.hir_id == expr.hir_id =>
683683
{
684684
// Point at `let` assignment type.
@@ -724,11 +724,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
724724
primary_span = pat.span;
725725
secondary_span = pat.span;
726726
match self.tcx.parent_hir_node(pat.hir_id) {
727-
hir::Node::Local(hir::Local { ty: Some(ty), .. }) => {
727+
hir::Node::Local(hir::LetStmt { ty: Some(ty), .. }) => {
728728
primary_span = ty.span;
729729
post_message = " type";
730730
}
731-
hir::Node::Local(hir::Local { init: Some(init), .. }) => {
731+
hir::Node::Local(hir::LetStmt { init: Some(init), .. }) => {
732732
primary_span = init.span;
733733
post_message = " value";
734734
}

compiler/rustc_hir_typeck/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14521452
});
14531453
let Some((
14541454
_,
1455-
hir::Node::Local(hir::Local { ty: Some(ty), .. })
1455+
hir::Node::Local(hir::LetStmt { ty: Some(ty), .. })
14561456
| hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(ty, _, _), .. }),
14571457
)) = parent_node
14581458
else {

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
371371

372372
fn walk_stmt(&mut self, stmt: &hir::Stmt<'_>) {
373373
match stmt.kind {
374-
hir::StmtKind::Let(hir::Local { pat, init: Some(expr), els, .. }) => {
374+
hir::StmtKind::Let(hir::LetStmt { pat, init: Some(expr), els, .. }) => {
375375
self.walk_local(expr, pat, *els, |_| {})
376376
}
377377

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16021602
}
16031603

16041604
/// Type check a `let` statement.
1605-
pub fn check_decl_local(&self, local: &'tcx hir::Local<'tcx>) {
1605+
pub fn check_decl_local(&self, local: &'tcx hir::LetStmt<'tcx>) {
16061606
self.check_decl(local.into());
16071607
if local.pat.is_never_pattern() {
16081608
self.diverges.set(Diverges::Always {
@@ -1790,7 +1790,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17901790
[
17911791
hir::Stmt {
17921792
kind:
1793-
hir::StmtKind::Let(hir::Local {
1793+
hir::StmtKind::Let(hir::LetStmt {
17941794
source:
17951795
hir::LocalSource::AssignDesugar(_),
17961796
..

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17311731

17321732
match self.tcx.parent_hir_node(*hir_id) {
17331733
// foo.clone()
1734-
hir::Node::Local(hir::Local { init: Some(init), .. }) => {
1734+
hir::Node::Local(hir::LetStmt { init: Some(init), .. }) => {
17351735
self.note_type_is_not_clone_inner_expr(init)
17361736
}
17371737
// When `expr` is more complex like a tuple
@@ -1740,7 +1740,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17401740
kind: hir::PatKind::Tuple(pats, ..),
17411741
..
17421742
}) => {
1743-
let hir::Node::Local(hir::Local { init: Some(init), .. }) =
1743+
let hir::Node::Local(hir::LetStmt { init: Some(init), .. }) =
17441744
self.tcx.parent_hir_node(*pat_hir_id)
17451745
else {
17461746
return expr;
@@ -1774,7 +1774,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
17741774
&& let hir::Path { segments: [_], res: crate::Res::Local(binding), .. } =
17751775
call_expr_path
17761776
&& let hir::Node::Pat(hir::Pat { hir_id, .. }) = self.tcx.hir_node(*binding)
1777-
&& let hir::Node::Local(hir::Local { init: Some(init), .. }) =
1777+
&& let hir::Node::Local(hir::LetStmt { init: Some(init), .. }) =
17781778
self.tcx.parent_hir_node(*hir_id)
17791779
&& let Expr {
17801780
kind: hir::ExprKind::Closure(hir::Closure { body: body_id, .. }),
@@ -3134,7 +3134,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
31343134
let hir::Node::Pat(pat) = self.tcx.hir_node(hir_id) else {
31353135
return;
31363136
};
3137-
let hir::Node::Local(hir::Local { ty: None, init: Some(init), .. }) =
3137+
let hir::Node::Local(hir::LetStmt { ty: None, init: Some(init), .. }) =
31383138
self.tcx.parent_hir_node(pat.hir_id)
31393139
else {
31403140
return;

compiler/rustc_hir_typeck/src/gather_locals.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl<'a> DeclOrigin<'a> {
2929
}
3030
}
3131

32-
/// A declaration is an abstraction of [hir::Local] and [hir::LetExpr].
32+
/// A declaration is an abstraction of [hir::LetStmt] and [hir::LetExpr].
3333
///
3434
/// It must have a hir_id, as this is how we connect gather_locals to the check functions.
3535
pub(super) struct Declaration<'a> {
@@ -41,9 +41,9 @@ pub(super) struct Declaration<'a> {
4141
pub origin: DeclOrigin<'a>,
4242
}
4343

44-
impl<'a> From<&'a hir::Local<'a>> for Declaration<'a> {
45-
fn from(local: &'a hir::Local<'a>) -> Self {
46-
let hir::Local { hir_id, pat, ty, span, init, els, source: _ } = *local;
44+
impl<'a> From<&'a hir::LetStmt<'a>> for Declaration<'a> {
45+
fn from(local: &'a hir::LetStmt<'a>) -> Self {
46+
let hir::LetStmt { hir_id, pat, ty, span, init, els, source: _ } = *local;
4747
Declaration { hir_id, pat, ty, span, init, origin: DeclOrigin::LocalDecl { els } }
4848
}
4949
}
@@ -120,7 +120,7 @@ impl<'a, 'tcx> GatherLocalsVisitor<'a, 'tcx> {
120120

121121
impl<'a, 'tcx> Visitor<'tcx> for GatherLocalsVisitor<'a, 'tcx> {
122122
// Add explicitly-declared locals.
123-
fn visit_local(&mut self, local: &'tcx hir::Local<'tcx>) {
123+
fn visit_local(&mut self, local: &'tcx hir::LetStmt<'tcx>) {
124124
self.declare(local.into());
125125
intravisit::walk_local(self, local)
126126
}

compiler/rustc_hir_typeck/src/method/suggest.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2166,7 +2166,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
21662166
match (filename, parent_node) {
21672167
(
21682168
FileName::Real(_),
2169-
Node::Local(hir::Local {
2169+
Node::Local(hir::LetStmt {
21702170
source: hir::LocalSource::Normal,
21712171
ty,
21722172
..
@@ -2221,7 +2221,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
22212221
impl<'v> Visitor<'v> for LetVisitor {
22222222
type Result = ControlFlow<Option<&'v hir::Expr<'v>>>;
22232223
fn visit_stmt(&mut self, ex: &'v hir::Stmt<'v>) -> Self::Result {
2224-
if let hir::StmtKind::Let(&hir::Local { pat, init, .. }) = ex.kind
2224+
if let hir::StmtKind::Let(&hir::LetStmt { pat, init, .. }) = ex.kind
22252225
&& let Binding(_, _, ident, ..) = pat.kind
22262226
&& ident.name == self.ident_name
22272227
{

compiler/rustc_hir_typeck/src/upvar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
217217
bug!();
218218
};
219219
for stmt in block.stmts {
220-
let hir::StmtKind::Let(hir::Local {
220+
let hir::StmtKind::Let(hir::LetStmt {
221221
init: Some(init),
222222
source: hir::LocalSource::AsyncFn,
223223
pat,

compiler/rustc_hir_typeck/src/writeback.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for WritebackCx<'cx, 'tcx> {
351351
intravisit::walk_pat(self, p);
352352
}
353353

354-
fn visit_local(&mut self, l: &'tcx hir::Local<'tcx>) {
354+
fn visit_local(&mut self, l: &'tcx hir::LetStmt<'tcx>) {
355355
intravisit::walk_local(self, l);
356356
let var_ty = self.fcx.local_ty(l.span, l.hir_id);
357357
let var_ty = self.resolve(var_ty, &l.span);

compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
21402140
// the same span as the error and the type is specified.
21412141
if let hir::Stmt {
21422142
kind:
2143-
hir::StmtKind::Let(hir::Local {
2143+
hir::StmtKind::Let(hir::LetStmt {
21442144
init: Some(hir::Expr { span: init_span, .. }),
21452145
ty: Some(array_ty),
21462146
..

0 commit comments

Comments
 (0)