We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fn main() { let x = subtract_one(4); println!("X = {}", x); }
fn subtract_one(x: i32) -> i32 { x - 1; }
Error message: error[E0308]: mismatched types --> main.rs:6:32 | 6 | fn subtract_one(x: i32) -> i32 { | ________________________________^ starting here... 7 | | x - 1; 8 | | } | |_^ ...ending here: expected (), found i32 | = note: expected type () found type i32 Shouldn't the error message say expected i32,found ()?
()
i32
rust version: rustc 1.18.0-nightly (3b5754e 2017-04-10)
The text was updated successfully, but these errors were encountered:
Duplicate of #41425.
Sorry, something went wrong.
Yep,seems like the same issue.Is anyone working on this?
No branches or pull requests
fn main() {
let x = subtract_one(4);
println!("X = {}", x);
}
fn subtract_one(x: i32) -> i32 {
x - 1;
}
Error message:
error[E0308]: mismatched types
--> main.rs:6:32
|
6 | fn subtract_one(x: i32) -> i32 {
| ________________________________^ starting here...
7 | | x - 1;
8 | | }
| |_^ ...ending here: expected (), found i32
|
= note: expected type
()
found type
i32
Shouldn't the error message say expected i32,found ()?
rust version:
rustc 1.18.0-nightly (3b5754e 2017-04-10)
The text was updated successfully, but these errors were encountered: