]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/issue-35030.rs
Auto merge of #76110 - FedericoPonzi:convert-openoptions-cint, r=JoshTriplett
[rust.git] / src / test / ui / mismatched_types / issue-35030.rs
1 #![allow(non_camel_case_types)]
2
3 trait Parser<T> {
4     fn parse(text: &str) -> Option<T>;
5 }
6
7 impl<bool> Parser<bool> for bool {
8     fn parse(text: &str) -> Option<bool> {
9         Some(true) //~ ERROR mismatched types
10     }
11 }
12
13 fn main() {
14     println!("{}", bool::parse("ok").unwrap_or(false));
15 }