mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 03:07:24 +03:00
fix: Fix block lowering in ast id map
This commit is contained in:
@@ -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"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user