about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-03 19:06:20 +0000
committerbors <bors@rust-lang.org>2022-04-03 19:06:20 +0000
commit2ad4eb207b369017f5140918b5e4b0d3650b46b0 (patch)
treefeaf81df91cd7a96502521ca1a07187c0ca942c7
parent168a0209002fef203e83989ff641c1b3e1a51859 (diff)
parent53887a5d9ee9b81bdcf8200787fa90d1710bb32d (diff)
downloadrust-2ad4eb207b369017f5140918b5e4b0d3650b46b0.tar.gz
rust-2ad4eb207b369017f5140918b5e4b0d3650b46b0.zip
Auto merge of #95610 - createyourpersonalaccount:derefmut-docfix, r=Dylan-DPC
Improve doc example of DerefMut

It is more illustrative, after using `*x` to modify the field, to show
in the assertion that the field has indeed been modified.
-rw-r--r--library/core/src/ops/deref.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/ops/deref.rs b/library/core/src/ops/deref.rs
index fb4ec83bc28..d68932402a4 100644
--- a/library/core/src/ops/deref.rs
+++ b/library/core/src/ops/deref.rs
@@ -164,7 +164,7 @@ impl<T: ?Sized> const Deref for &mut T {
 ///
 /// let mut x = DerefMutExample { value: 'a' };
 /// *x = 'b';
-/// assert_eq!('b', *x);
+/// assert_eq!('b', x.value);
 /// ```
 #[lang = "deref_mut"]
 #[doc(alias = "*")]