mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Store patterns desugared from destructuring assignments in source map
And few more fixups. I was worried this will lead to more memory usage since `ExprOrPatId` is double the size of `ExprId`, but this does not regress `analysis-stats .`. If this turns out to be a problem, we can easily use the high bit to encode this information.
This commit is contained in:
parent
61f162a43d
commit
2d4d6b678f
16 changed files with 280 additions and 174 deletions
|
@ -198,7 +198,10 @@ impl TestDB {
|
|||
.filter_map(|node| {
|
||||
let block = ast::BlockExpr::cast(node)?;
|
||||
let expr = ast::Expr::from(block);
|
||||
let expr_id = source_map.node_expr(InFile::new(position.file_id.into(), &expr))?;
|
||||
let expr_id = source_map
|
||||
.node_expr(InFile::new(position.file_id.into(), &expr))?
|
||||
.as_expr()
|
||||
.unwrap();
|
||||
let scope = scopes.scope_for(expr_id).unwrap();
|
||||
Some(scope)
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue