You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> src/main.rs:7:39
|
1 | fn main(){
| - expected `()` because of default return type
...
7 | thingy(if let Some(r) = opt{ r }else{None});
| ^ expected enum `std::option::Option`, found mutable reference
|
= note: expected type `std::option::Option<&muti32>`
found type `&mut{integer}`
For some reason rustc appears to include the return type of main as if it was important here, even though the expression is passing the return value to the thingy function.
The text was updated successfully, but these errors were encountered:
Playground link: https://play.rust-lang.org/?gist=41596a413b9d567407a84423bd63174a&version=stable&mode=debug
Error:
For some reason
rustc
appears to include the return type ofmain
as if it was important here, even though the expression is passing the return value to thethingy
function.The text was updated successfully, but these errors were encountered: