Skip to content

Commit a0ed4d8

Browse files
committed
Copy faillibility warning to DerefMut
1 parent 14619de commit a0ed4d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/ops/deref.rs

+4
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ impl<T: ?Sized> Deref for &mut T {
213213
/// it may be acceptable to panic if the type is misused through programmer
214214
/// error, for example.
215215
///
216+
/// However, infallibility is not enforced and therefore not guaranteed.
217+
/// As such, `unsafe` code should not rely on infallibility in general for
218+
/// soundness.
219+
///
216220
/// [book]: ../../book/ch15-02-deref.html
217221
/// [coercion]: #mutable-deref-coercion
218222
/// [implementing]: Deref#when-to-implement-deref-or-derefmut

0 commit comments

Comments
 (0)