use std::mem; // Make sure we notice the mismatch also if the difference is "only" in the generic // parameters of the trait. trait Trait {} impl Trait for T {} fn main() { let x: &dyn Trait = &0; let _y: *const dyn Trait = unsafe { mem::transmute(x) }; //~ERROR: wrong trait }