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
triplets.rs:4:10: 4:14 error: mismatched types:
expected `()`,
found `collections::vec::Vec<i32>`
(expected (),
found struct `collections::vec::Vec`) [E0308]
triplets.rs:4 return num1;
^~~~
triplets.rs:4:10: 4:14 help: run `rustc --explain E0308` to see a detailed explanation
I think the compiler should try to propose a FIXIT, e.g. maybe did you mean fn get_numbers(arr1 : String) -> Vec<i32>
Also, rustc --explain E0308 doesn't list the missing -> return_type case as "common mistake". Not sure if it's really worth listing it, but still, worth mentioning.
The text was updated successfully, but these errors were encountered:
dcci
changed the title
Propose a FIXIT when the return type is missed from the function definition
Propose a FIXIT when the return type is missing from the function definition
Aug 7, 2016
This obviously fails with:
I think the compiler should try to propose a
FIXIT
, e.g.maybe did you mean fn get_numbers(arr1 : String) -> Vec<i32>
Also,
rustc --explain E0308
doesn't list the missing-> return_type
case as "common mistake". Not sure if it's really worth listing it, but still, worth mentioning.The text was updated successfully, but these errors were encountered: