[][src]Function metatype::type_coerce

pub fn type_coerce<A, B>(a: A) -> B

Convert from one type parameter to another, where they are the same type. Panics with an explanatory message if the types differ.

In almost all circumstances this isn't needed, but it can be very useful in cases like rust-lang/rust#50318.