diff options
| author | bors <bors@rust-lang.org> | 2022-07-13 17:13:27 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-07-13 17:13:27 +0000 |
| commit | c80dde43f992f3eb419899a34551b84c6301f8e8 (patch) | |
| tree | 8cdaab3defdcc525a68f7dba82c23e62be66fa9c /compiler/rustc_hir | |
| parent | 42bd138126b0a9d38d65bc9973e72de3c5b6c37f (diff) | |
| parent | 3933b2b310e9358b77269e69b0656d12a126e14a (diff) | |
| download | rust-c80dde43f992f3eb419899a34551b84c6301f8e8.tar.gz rust-c80dde43f992f3eb419899a34551b84c6301f8e8.zip | |
Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #98574 (Lower let-else in MIR) - #99011 (`UnsafeCell` blocks niches inside its nested type from being available outside) - #99030 (diagnostics: error messages when struct literals fail to parse) - #99155 (Keep unstable target features for asm feature checking) - #99199 (Refactor: remove an unnecessary `span_to_snippet`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_hir')
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/intravisit.rs | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 04f585df34c..ed874ae829b 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1316,6 +1316,8 @@ pub struct Local<'hir> { pub ty: Option<&'hir Ty<'hir>>, /// Initializer expression to set the value, if any. pub init: Option<&'hir Expr<'hir>>, + /// Else block for a `let...else` binding. + pub els: Option<&'hir Block<'hir>>, pub hir_id: HirId, pub span: Span, /// Can be `ForLoopDesugar` if the `let` statement is part of a `for` loop diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index 531d9f14040..b5d9769c578 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -472,6 +472,9 @@ pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local<'v>) { walk_list!(visitor, visit_expr, &local.init); visitor.visit_id(local.hir_id); visitor.visit_pat(&local.pat); + if let Some(els) = local.els { + visitor.visit_block(els); + } walk_list!(visitor, visit_ty, &local.ty); } |
