#![allow(non_camel_case_types)] trait Parser { fn parse(text: &str) -> Option; } impl Parser for bool { fn parse(text: &str) -> Option { Some(true) //~ ERROR mismatched types } } fn main() { println!("{}", bool::parse("ok").unwrap_or(false)); }