Function type_equalities::coerce_ref[][src]

pub fn coerce_ref<'a, T: ?Sized, U: ?Sized>(t: &'a T, ev: TypeEq<T, U>) -> &'a U

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

Examples

assert_eq!(*coerce_ref(&42, refl()), 42);