Skip to content

Commit 16b4dc0

Browse files
authored
Rollup merge of #72834 - JOE1994:correct_confusing_term, r=sfackler
Rephrase term 'non-pointer type' Hello 🐈 , If the reader assumes that 'pointer type's include 'smart pointer's, the term 'non-pointer type' could mislead the reader to assume that x should not be a smart pointer type. I tried to rephrase the term 'non-pointer type' to remove ambiguity in the doc comments. closes #72335 Thank you for reviewing this PR! 🦸‍♀️
2 parents b6a5fea + 3048a41 commit 16b4dc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libcore/ops/deref.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
///
1919
/// If `T` implements `Deref<Target = U>`, and `x` is a value of type `T`, then:
2020
///
21-
/// * In immutable contexts, `*x` on non-pointer types is equivalent to
22-
/// `*Deref::deref(&x)`.
21+
/// * In immutable contexts, `*x` (where `T` is neither a reference nor a raw pointer)
22+
/// is equivalent to `*Deref::deref(&x)`.
2323
/// * Values of type `&T` are coerced to values of type `&U`
2424
/// * `T` implicitly implements all the (immutable) methods of the type `U`.
2525
///
@@ -115,8 +115,8 @@ impl<T: ?Sized> Deref for &mut T {
115115
/// If `T` implements `DerefMut<Target = U>`, and `x` is a value of type `T`,
116116
/// then:
117117
///
118-
/// * In mutable contexts, `*x` on non-pointer types is equivalent to
119-
/// `*DerefMut::deref_mut(&mut x)`.
118+
/// * In mutable contexts, `*x` (where `T` is neither a reference nor a raw pointer)
119+
/// is equivalent to `*DerefMut::deref_mut(&mut x)`.
120120
/// * Values of type `&mut T` are coerced to values of type `&mut U`
121121
/// * `T` implicitly implements all the (mutable) methods of the type `U`.
122122
///

0 commit comments

Comments
 (0)