summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/issue-35030.rs
blob: 91ea7ea80c3d733aa2999be7c9ae63c5b7e76a05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![allow(non_camel_case_types)]

trait Parser<T> {
    fn parse(text: &str) -> Option<T>;
}

impl<bool> Parser<bool> for bool {
    fn parse(text: &str) -> Option<bool> {
        Some(true) //~ ERROR mismatched types
    }
}

fn main() {
    println!("{}", bool::parse("ok").unwrap_or(false));
}