1 #![feature(try_trait_v2)]
6 // error for a `Try` type on a non-`Try` fn
7 std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
9 // a non-`Try` type on a non-`Try` fn
10 ()?; //~ ERROR the `?` operator can only be applied to
11 //~^ ERROR the `?` operator can only be used in a function that
13 // an unrelated use of `Try`
14 try_trait_generic::<()>(); //~ ERROR the trait bound
17 fn try_trait_generic<T: Try>() -> T {
18 // and a non-`Try` object on a `Try` fn.
19 ()?; //~ ERROR the `?` operator can only be applied to values that implement `Try`