-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language teamfixed-by-thir-unsafeck`-Z thir-unsafeck` handles this correctly.`-Z thir-unsafeck` handles this correctly.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
Seen in #79735
I tried this code:
fn foo(ptr: *const bool) {
let _ = *ptr;
}
Which, oddly, happily compiled despite the syntactic pointer dereference.
Back in 1.21, however, that gave the expected error:
error[E0133]: dereference of raw pointer requires unsafe function or block
--> <source>:2:13
|
2 | let _ = *ptr;
| ^^^^ dereference of raw pointer
error: aborting due to previous error
https://rust.godbolt.org/z/rP93nf
The conversation in the 2020-12-15 lang team meeting implied that this was an unexpected regression, so opening and nomination for further discussion.
kornelski, helltraitor and zohnannor
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language teamfixed-by-thir-unsafeck`-Z thir-unsafeck` handles this correctly.`-Z thir-unsafeck` handles this correctly.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.