We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b485bf3 commit 67d5916Copy full SHA for 67d5916
const_safety.md
@@ -114,13 +114,13 @@ some extensions of the miri engine that are already implemented in miri) even
114
though it uses raw pointer operations:
115
```rust
116
const fn test_eq<T>(x: &T, y: &T) -> bool {
117
- x as *const _ == y as *const _
+ unsafe { x as *const _ == y as *const _ }
118
}
119
```
120
On the other hand, the following function is *not* const-safe and hence it is considered a bug to mark it as such:
121
122
const fn convert<T>(x: &T) -> usize {
123
- x as *const _ as usize
+ unsafe { x as *const _ as usize }
124
125
126
0 commit comments