Merge pull request #18254 from ChayimFriedman2/fix-mut

fix: Nail destructuring assignment once and for all
This commit is contained in:
Lukas Wirth 2024-10-22 17:40:52 +00:00 committed by GitHub
commit c286786888
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 1171 additions and 860 deletions

View file

@ -11,7 +11,7 @@ use std::{
use either::Either;
use hir_def::{
hir::Expr,
hir::{Expr, ExprOrPatId},
lower::LowerCtx,
nameres::{MacroSubNs, ModuleOrigin},
path::ModPath,
@ -1777,7 +1777,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;
}