error[E0308]: try expression alternatives have incompatible types
--> src/main.rs:5:9
|
5 | foo(bar()?);
| ^^^^^^
| |
| expected &i32, found i32
| help: try wrapping with a success variant: `Ok(bar()?)`
|
= note: expected type `&i32`
found type `i32`
error[E0308]: mismatched types
--> src/main.rs:5:9
|
5 | foo(bar()?);
| ^^^^^^
| |
| expected &i32, found i32
| help: consider borrowing here: `&bar()?`
|
= note: expected type `&i32`
found type `i32`
Steps to reproduce:
?&Example code: https://play.rust-lang.org/?gist=c75cddbb4c5d8a1b63ec11dc3c5bca43&version=stable&mode=debug&edition=2015
Output:
Expected output: