Function type_equalities::coerce[][src]

pub fn coerce<T, U>(t: T, ev: TypeEq<T, U>) -> U
Expand description

Coerce a value of type T to a value of type U, given evidence that T == U.

Note that this is operationally a no-op.

There is also a receiver version of this, TypeEq::coerce.

Examples

assert_eq!(coerce(42, refl()), 42);