File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -898,12 +898,11 @@ pub const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str {
898898}
899899
900900
901- /// Attempts to view `T` as a reference to the trait object `U`.
902- ///
903- /// Returns `Some(&U)` if the type `T` implements `U`, and `None` otherwise.
901+
902+ /// Returns `Some(&U)` if `T` can be coerced to the trait object type `U`. Otherwise, it returns `None`.
904903///
905904/// # Compile-time failures
906- /// Determining whether `T` implements `U` requires trait resolution by the compiler .
905+ /// Determining whether `T` can be coerced to the trait object type `U` requires compiler trait resolution.
907906/// In some cases, that resolution can exceed the recursion limit,
908907/// and compilation will fail *instead of* this function returning `None`.
909908/// # Examples
@@ -953,12 +952,11 @@ pub const fn try_as_dyn<
953952 }
954953}
955954
956- /// Attempts to view `T` as a reference to the trait object `U`.
957- ///
958- /// Returns `Some(&mut U)` if the type `T` implements `U`, and `None` otherwise.
955+
956+ /// Returns `Some(&mut U)` if `T` can be coerced to the trait object type `U`. Otherwise, it returns `None`.
959957///
960958/// # Compile-time failures
961- /// Determining whether `T` implements `U` requires trait resolution by the compiler .
959+ /// Determining whether `T` can be coerced to the trait object type `U` requires compiler trait resolution.
962960/// In some cases, that resolution can exceed the recursion limit,
963961/// and compilation will fail *instead of* this function returning `None`.
964962/// # Examples
Original file line number Diff line number Diff line change @@ -2657,10 +2657,10 @@ pub unsafe fn vtable_size(ptr: *const ()) -> usize;
26572657#[ rustc_intrinsic]
26582658pub unsafe fn vtable_align ( ptr : * const ( ) ) -> usize ;
26592659
2660- /// The intrinsic returns the vtable of `T` through the lens of `U`.
2660+ /// The intrinsic returns the `U` vtable for `T` if `T` can be coerced to the trait object type `U`.
26612661///
26622662/// # Compile-time failures
2663- /// Determining whether `T` implements `U` requires trait resolution by the compiler.
2663+ /// Determining whether `T` can be coerced to the trait object type `U` requires trait resolution by the compiler.
26642664/// In some cases, that resolution can exceed the recursion limit,
26652665/// and compilation will fail *instead of* this function returning `None`.
26662666///
You can’t perform that action at this time.
0 commit comments