Skip to content

Fix Rust conditional derives and unsafe indexing - #2664

Merged
Widthdom merged 6 commits into
mainfrom
fix-issue2052-2053
May 25, 2026
Merged

Fix Rust conditional derives and unsafe indexing#2664
Widthdom merged 6 commits into
mainfrom
fix-issue2052-2053

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Index Rust multiline cfg_attr(..., derive(...)) trait references with correct source positions.
  • Index Rust unsafe { ... } blocks as scoped containers, including expression-position blocks.
  • Emit Rust mutable reference target types for &mut Type while avoiding mutable-borrow expression false positives.

Changelog

  • changelog.d/unreleased/2052.fixed.md
  • changelog.d/unreleased/2053.fixed.md

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -p:UseSharedCompilation=false --filter "RustMultilineCfgAttrDeriveAttributes|RustMutableReferenceTypes|RustMutableDynAndImplReferences|RustMutableBorrowExpression"
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Release -p:UseSharedCompilation=false --filter "Rust_DetectsUnsafeBlockContainer|Rust_DetectsUnsafeBlockInExpression"
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~RustMutableReferenceTypes|FullyQualifiedName~RustMutableDynAndImpl|FullyQualifiedName~RustMultilineCfgAttr|FullyQualifiedName~UnsafeBlock"
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • Codex adversarial review: No blocking/actionable issues found.

Full dotnet test CodeIndex.sln -c Release -p:UseSharedCompilation=false was attempted earlier, showed no failures while running, but was stopped after a long silent run before a final test summary.

Fixes #2052
Fixes #2053

@Widthdom
Widthdom merged commit 8c4576d into main May 25, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue2052-2053 branch May 25, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant