fix: Fix block lowering in ast id map

This commit is contained in:
Lukas Wirth
2026-03-29 11:12:27 +02:00
parent a1c519d037
commit de6826beff
@@ -678,9 +678,10 @@ pub fn from_source(node: &SyntaxNode) -> AstIdMap {
}
}
syntax::WalkEvent::Leave(node) => {
if cfg!(debug_assertions) && ast::BlockExpr::can_cast(node.kind()) {
assert_eq!(
blocks.pop().map(|it| it.0),
if ast::BlockExpr::can_cast(node.kind()) {
let block = blocks.pop();
debug_assert_eq!(
block.map(|it| it.0),
Some(node),
"left a BlockExpr we never entered"
);