-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
False postive: warning of unnecessary unsafe block #152374
Copy link
Copy link
Closed
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-langRelevant to the language teamRelevant to the language teamT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
Description
Activity
Metadata
Metadata
Assignees
Labels
C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.S-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueT-langRelevant to the language teamRelevant to the language teamT-libs-api[DEPRECATED; DO NOT USE][DEPRECATED; DO NOT USE]
Code
I tried this code:
I expected to see this happen: it compiles without warnings.
Instead, this happened: it compiles with a warning of unnecessary
unsafeblockVersion it worked on
Stable channel 1.93.0 doesn't emit that.
Version with regression
Beta channel 1.94.0-beta.2 emits that. (2026-01-25 23a44d3)
Nightly channel 1.95.0-nightly emits that. (2026-02-08 6efa357)
The code can be reproduced on the present plaground: stable vs beta.