mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Merge pull request #18254 from ChayimFriedman2/fix-mut
fix: Nail destructuring assignment once and for all
This commit is contained in:
commit
c286786888
29 changed files with 1171 additions and 860 deletions
|
@ -328,7 +328,7 @@ impl SourceToDefCtx<'_, '_> {
|
|||
.position(|it| it == *src.value)?;
|
||||
let container = self.find_pat_or_label_container(src.syntax_ref())?;
|
||||
let (_, source_map) = self.db.body_with_source_map(container);
|
||||
let expr = source_map.node_expr(src.with_value(&ast::Expr::AsmExpr(asm)))?;
|
||||
let expr = source_map.node_expr(src.with_value(&ast::Expr::AsmExpr(asm)))?.as_expr()?;
|
||||
Some(InlineAsmOperand { owner: container, expr, index })
|
||||
}
|
||||
|
||||
|
@ -372,7 +372,8 @@ impl SourceToDefCtx<'_, '_> {
|
|||
let break_or_continue = ast::Expr::cast(src.value.syntax().parent()?)?;
|
||||
let container = self.find_pat_or_label_container(src.syntax_ref())?;
|
||||
let (body, source_map) = self.db.body_with_source_map(container);
|
||||
let break_or_continue = source_map.node_expr(src.with_value(&break_or_continue))?;
|
||||
let break_or_continue =
|
||||
source_map.node_expr(src.with_value(&break_or_continue))?.as_expr()?;
|
||||
let (Expr::Break { label, .. } | Expr::Continue { label }) = body[break_or_continue] else {
|
||||
return None;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue