]> git.lizzy.rs Git - rust.git/blob - src/test/ui/try-on-option-diagnostics.rs
Rollup merge of #65994 - estebank:where-bound, r=nikomatsakis
[rust.git] / src / test / ui / try-on-option-diagnostics.rs
1 #![feature(try_trait)]
2 // edition:2018
3 fn main() {}
4
5 fn a_function() -> u32 {
6     let x: Option<u32> = None;
7     x?; //~ ERROR the `?` operator
8     22
9 }
10
11 fn a_closure() -> u32 {
12     let a_closure = || {
13         let x: Option<u32> = None;
14         x?; //~ ERROR the `?` operator
15         22
16     };
17     a_closure()
18 }