vtable_for in std::intrinsics - Rust
Description: The intrinsic returns the `U` vtable for `T` if `T` can be coerced to the trait object type `U`.

## vtable_for

# Function vtable_for

Source

    pub const fn vtable_for<T, U>() -> Option<DynMetadata<U>>where
        U: Pointee<Metadata = DynMetadata<U>> + ?Sized,

🔬This is a nightly-only experimental API. (`core_intrinsics`)
Expand description

The intrinsic returns the `U` vtable for `T` if `T` can be coerced to the trait object type `U`.

## §Compile-time failures

Determining whether `T` can be coerced to the trait object type `U` requires trait resolution by the compiler. In some cases, that resolution can exceed the recursion limit, and compilation will fail instead of this function returning `None`.