Skip to content

Commit e6b761b

Browse files
committed
fixup! docs: Improve AsRef / AsMut docs on blanket impls
Changed wording in sections on "Reflexivity": replaced "that is there is" with "i.e. there would be" and removed comma before "with" Reason: "there is" somewhat contradicted the "would be" hypothetical. A slightly redundant wording has now been chosen for better clarity. The comma seemed to be superfluous.
1 parent e4a259b commit e6b761b

File tree

1 file changed

+4
-4
lines changed
  • library/core/src/convert

1 file changed

+4
-4
lines changed

library/core/src/convert/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ pub const fn identity<T>(x: T) -> T {
172172
///
173173
/// # Reflexivity
174174
///
175-
/// Ideally, `AsRef` would be reflexive, that is there is an `impl<T: ?Sized> AsRef<T> for T`, with
176-
/// [`as_ref`] simply returning its argument unchanged.
175+
/// Ideally, `AsRef` would be reflexive, i.e. there would be an `impl<T: ?Sized> AsRef<T> for T`
176+
/// with [`as_ref`] simply returning its argument unchanged.
177177
/// Such a blanket implementation is currently *not* provided due to technical restrictions of
178178
/// Rust's type system (it would be overlapping with another existing blanket implementation for
179179
/// `&T where T: AsRef<U>` which allows `AsRef` to auto-dereference, see "Generic Implementations"
@@ -283,8 +283,8 @@ pub trait AsRef<T: ?Sized> {
283283
///
284284
/// # Reflexivity
285285
///
286-
/// Ideally, `AsMut` would be reflexive, that is there is an `impl<T: ?Sized> AsMut<T> for T`, with
287-
/// [`as_mut`] simply returning its argument unchanged.
286+
/// Ideally, `AsMut` would be reflexive, i.e. there would be an `impl<T: ?Sized> AsMut<T> for T`
287+
/// with [`as_mut`] simply returning its argument unchanged.
288288
/// Such a blanket implementation is currently *not* provided due to technical restrictions of
289289
/// Rust's type system (it would be overlapping with another existing blanket implementation for
290290
/// `&mut T where T: AsMut<U>` which allows `AsMut` to auto-dereference, see "Generic

0 commit comments

Comments
 (0)