trait Trait: Sized { fn is_reference(self) -> bool; } impl<'a, T> Trait for &'a T { fn is_reference(self) -> bool { true } } fn main() { match 0.is_reference() { true => print!("1"), false => print!("0"), } match '?'.is_reference() { true => print!("1"), false => { impl Trait for char { fn is_reference(self) -> bool { false } } print!("0") } } }