Skip to content

Commit 2ebeeef

Browse files
committed
fix: Fix block lowering in ast id map
1 parent 7687101 commit 2ebeeef

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

crates/span/src/ast_id.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,10 @@ impl AstIdMap {
678678
}
679679
}
680680
syntax::WalkEvent::Leave(node) => {
681-
if cfg!(debug_assertions) && ast::BlockExpr::can_cast(node.kind()) {
682-
assert_eq!(
683-
blocks.pop().map(|it| it.0),
681+
if ast::BlockExpr::can_cast(node.kind()) {
682+
let block = blocks.pop();
683+
debug_assert_eq!(
684+
block.map(|it| it.0),
684685
Some(node),
685686
"left a BlockExpr we never entered"
686687
);

0 commit comments

Comments
 (0)