Skip to content

Commit

Permalink
Copy faillibility warning to DerefMut
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaargh committed Oct 21, 2023
1 parent 14619de commit a0ed4d8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/core/src/ops/deref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ impl<T: ?Sized> Deref for &mut T {
/// it may be acceptable to panic if the type is misused through programmer
/// error, for example.
///
/// However, infallibility is not enforced and therefore not guaranteed.
/// As such, `unsafe` code should not rely on infallibility in general for
/// soundness.
///
/// [book]: ../../book/ch15-02-deref.html
/// [coercion]: #mutable-deref-coercion
/// [implementing]: Deref#when-to-implement-deref-or-derefmut
Expand Down

0 comments on commit a0ed4d8

Please sign in to comment.