File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -2285,6 +2285,10 @@ impl<F: FnPtr> fmt::Debug for F {
22852285/// `addr_of!(expr)` is equivalent to `&raw const expr`. The macro is *soft-deprecated*;
22862286/// use `&raw const` instead.
22872287///
2288+ /// It is still an open question whether writing through an `addr_of!`-created pointer is permitted
2289+ /// or not. Until that is decided, the same rules as for shared references apply: it is UB to write
2290+ /// through a pointer created with this operation, except for bytes located inside an `UnsafeCell`.
2291+ ///
22882292/// Creating a reference with `&`/`&mut` is only allowed if the pointer is properly aligned
22892293/// and points to initialized data. For cases where those requirements do not hold,
22902294/// raw pointers should be used instead. However, `&expr as *const _` creates a reference
You can’t perform that action at this time.
0 commit comments