rust/src/test/ui/issue-59756.rs
David Wood 16592f691b
Suggest removing ? to resolve type errors.
This commit adds a suggestion to remove the `?` from expressions if
removing the `?` would resolve a type error.
2019-04-10 23:52:01 +02:00

18 lines
227 B
Rust

// run-rustfix
#![allow(warnings)]
struct A;
struct B;
fn foo() -> Result<A, B> {
Ok(A)
}
fn bar() -> Result<A, B> {
foo()?
//~^ ERROR try expression alternatives have incompatible types [E0308]
}
fn main() {}