Skip to content

fix: 'no entry found for key' panic in VFS - #23120

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
Wilfred:fix-resolve-path-unknown-anchor
Aug 11, 2026
Merged

fix: 'no entry found for key' panic in VFS#23120
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
Wilfred:fix-resolve-path-unknown-anchor

Conversation

@Wilfred

@Wilfred Wilfred commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

The doc comment of resolve_path() claims that it returns None if the path's anchor isn't present, but it actually panics due to [] indexing.

Return None instead, matching the documented behaviour.

I've seen this crash impact a handful of users, but I haven't been able to replicate it myself. It seems to occur when files are deleted, probably when switching branches. It also seems to recover when the crate graph is rebuilt.

The fix seems obviously correct though, so I've just changed the code without a regression test.

AI disclosure: Some Opus 5 usage for the code changes.

The doc comment of `resolve_path()` claims that it returns None if the
path's anchor isn't present, but it actually panics due to `[]`
indexing.

Return None instead, matching the documented behaviour.

I've seen this crash impact a handful of users, but I haven't been
able to replicate it myself. It seems to occur when files are deleted,
probably when switching branches. It also seems to recover when the
crate graph is rebuilt.

The fix seems obviously correct though, so I've just changed the code
without a regression test.

AI disclosure: Some Opus 5 usage for the code changes.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2026
@ChayimFriedman2
ChayimFriedman2 added this pull request to the merge queue Aug 11, 2026
Merged via the queue into rust-lang:master with commit 2eac6cb Aug 11, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 11, 2026
@Wilfred
Wilfred deleted the fix-resolve-path-unknown-anchor branch August 11, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants