-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
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-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.