From 7b09e1c82b35ca564e3a6dce5e06271733571646 Mon Sep 17 00:00:00 2001 From: Eric Seppanen Date: Tue, 11 Nov 2025 11:46:08 -0800 Subject: [PATCH 1/2] improve primitive reference PartialEq docs This sentence was unnecessarily complex; try to simplify it. --- library/core/src/primitive_docs.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 1c824e336bed7..5988e477973f6 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -1531,9 +1531,8 @@ mod prim_usize {} /// `&mut T` references can be freely coerced into `&T` references with the same referent type, and /// references with longer lifetimes can be freely coerced into references with shorter ones. /// -/// Reference equality by address, instead of comparing the values pointed to, is accomplished via -/// implicit reference-pointer coercion and raw pointer equality via [`ptr::eq`], while -/// [`PartialEq`] compares values. +/// [`PartialEq`] will compare referenced values. It is possible to compare the reference address +/// using reference-pointer coercion and raw pointer equality via [`ptr::eq`]. /// /// ``` /// use std::ptr; From cac1f99d6dce2ffc1cfdf24be9a30e4adeb26e9d Mon Sep 17 00:00:00 2001 From: Eric Seppanen Date: Tue, 11 Nov 2025 11:46:08 -0800 Subject: [PATCH 2/2] fix typo in primitive reference docs --- library/core/src/primitive_docs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 5988e477973f6..15ba72bccaa9b 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -1647,7 +1647,7 @@ mod prim_usize {} /// For the other direction, things are more complicated: when unsafe code passes arguments /// to safe functions or returns values from safe functions, they generally must *at least* /// not violate these invariants. The full requirements are stronger, as the reference generally -/// must point to data that is safe to use at type `T`. +/// must point to data that is safe to use as type `T`. /// /// It is not decided yet whether unsafe code may violate these invariants temporarily on internal /// data. As a consequence, unsafe code which violates these invariants temporarily on internal data