mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +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
|
@ -11,7 +11,7 @@ use std::{
|
|||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
hir::Expr,
|
||||
hir::{Expr, ExprOrPatId},
|
||||
lower::LowerCtx,
|
||||
nameres::{MacroSubNs, ModuleOrigin},
|
||||
path::ModPath,
|
||||
|
@ -1755,7 +1755,9 @@ impl<'db> SemanticsImpl<'db> {
|
|||
}
|
||||
|
||||
if let Some(parent) = ast::Expr::cast(parent.clone()) {
|
||||
if let Some(expr_id) = source_map.node_expr(InFile { file_id, value: &parent }) {
|
||||
if let Some(ExprOrPatId::ExprId(expr_id)) =
|
||||
source_map.node_expr(InFile { file_id, value: &parent })
|
||||
{
|
||||
if let Expr::Unsafe { .. } = body[expr_id] {
|
||||
break true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue