Skip to content

Commit 23cd7d7

Browse files
committed
Adjusted documentation further
1 parent 8d50b7b commit 23cd7d7

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

library/core/src/any.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -908,12 +908,11 @@ pub const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str {
908908
}
909909

910910

911-
/// Attempts to view `T` as a reference to the trait object `U`.
912-
///
913-
/// Returns `Some(&U)` if the type `T` implements `U`, and `None` otherwise.
911+
912+
/// Returns `Some(&U)` if `T` can be coerced to the trait object type `U`. Otherwise, it returns `None`.
914913
///
915914
/// # Compile-time failures
916-
/// Determining whether `T` implements `U` requires trait resolution by the compiler.
915+
/// Determining whether `T` can be coerced to the trait object type `U` requires compiler trait resolution.
917916
/// In some cases, that resolution can exceed the recursion limit,
918917
/// and compilation will fail *instead of* this function returning `None`.
919918
/// # Examples
@@ -963,12 +962,11 @@ pub const fn try_as_dyn<
963962
}
964963
}
965964

966-
/// Attempts to view `T` as a reference to the trait object `U`.
967-
///
968-
/// Returns `Some(&mut U)` if the type `T` implements `U`, and `None` otherwise.
965+
966+
/// Returns `Some(&mut U)` if `T` can be coerced to the trait object type `U`. Otherwise, it returns `None`.
969967
///
970968
/// # Compile-time failures
971-
/// Determining whether `T` implements `U` requires trait resolution by the compiler.
969+
/// Determining whether `T` can be coerced to the trait object type `U` requires compiler trait resolution.
972970
/// In some cases, that resolution can exceed the recursion limit,
973971
/// and compilation will fail *instead of* this function returning `None`.
974972
/// # Examples

library/core/src/intrinsics/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,10 +2754,10 @@ pub unsafe fn vtable_size(ptr: *const ()) -> usize;
27542754
#[rustc_intrinsic]
27552755
pub unsafe fn vtable_align(ptr: *const ()) -> usize;
27562756

2757-
/// The intrinsic returns the vtable of `T` through the lens of `U`.
2757+
/// The intrinsic returns the `U` vtable for `T` if `T` can be coerced to the trait object type `U`.
27582758
///
27592759
/// # Compile-time failures
2760-
/// Determining whether `T` implements `U` requires trait resolution by the compiler.
2760+
/// Determining whether `T` can be coerced to the trait object type `U` requires trait resolution by the compiler.
27612761
/// In some cases, that resolution can exceed the recursion limit,
27622762
/// and compilation will fail *instead of* this function returning `None`.
27632763
///

0 commit comments

Comments
 (0)