]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-35030.rs
Merge commit '7f27e2e74ef957baa382dc05cf08df6368165c74' into clippyup
[rust.git] / tests / 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 }