In highlight_related, when on an unsafe block, don't highlight unsafe operations of other unsafe blocks

This commit is contained in:
Chayim Refael Friedman 2025-08-26 21:46:04 +03:00
parent 1f4e5e82ff
commit 1efff4677e
4 changed files with 44 additions and 10 deletions

View file

@ -1283,7 +1283,7 @@ impl<'db> SourceAnalyzer<'db> {
{
let mut is_unsafe = false;
let mut walk_expr = |expr_id| {
unsafe_operations(db, infer, def, body, expr_id, &mut |inside_unsafe_block| {
unsafe_operations(db, infer, def, body, expr_id, &mut |_, inside_unsafe_block| {
is_unsafe |= inside_unsafe_block == InsideUnsafeBlock::No
})
};