Rollup merge of #116187 - estebank:small-tweak, r=compiler-errors
Add context to `let: Ty = loop { break };` We weren't accounting for the case where `break` was immediately within the `loop` block.
This commit is contained in:
commit
a6f066596b
4 changed files with 23 additions and 5 deletions
|
@ -545,6 +545,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
// Climb the HIR tree to see if the current `Expr` is part of a `break;` statement.
|
||||
let Some(
|
||||
hir::Node::Stmt(hir::Stmt { kind: hir::StmtKind::Semi(&ref p), .. })
|
||||
| hir::Node::Block(hir::Block { expr: Some(&ref p), .. })
|
||||
| hir::Node::Expr(&ref p),
|
||||
) = self.tcx.hir().find(parent_id)
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue