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.
2 parents af927e4 + d8b995a commit 0e6ebf0Copy full SHA for 0e6ebf0
text/2582-raw-reference-mir-operator.md
@@ -198,14 +198,14 @@ This has the side-effect of being able to entirely remove reference-to-pointer-*
198
199
```rust
200
let x: *mut Struct = NonNull::dangling().as_ptr();
201
-let field: *mut Field = &mut x.field;
+let field: *mut Field = &mut (*x).field;
202
```
203
204
The lint as described in this RFC would nudge people to instead write
205
206
207
208
-let field: *mut Field = &raw mut x.field;
+let field: *mut Field = &raw mut (*x).field;
209
210
211
which is better, but still UB: we emit a `getelementptr inbounds` for the `.field` offset computation.
0 commit comments