]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-35030.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[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 }