Do if-expression obligation stuff less eagerly
This commit is contained in:
parent
3d9dd681f5
commit
99c32570bb
11 changed files with 411 additions and 350 deletions
|
@ -954,6 +954,16 @@ pub struct Block<'hir> {
|
|||
pub targeted_by_break: bool,
|
||||
}
|
||||
|
||||
impl<'hir> Block<'hir> {
|
||||
pub fn peel_blocks(&self) -> &Block<'hir> {
|
||||
let mut block = self;
|
||||
while let Some(Expr { kind: ExprKind::Block(inner_block, _), .. }) = block.expr {
|
||||
block = inner_block;
|
||||
}
|
||||
block
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, HashStable_Generic)]
|
||||
pub struct Pat<'hir> {
|
||||
#[stable_hasher(ignore)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue