Skip to content
New issue

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

error messages for semicolon issues #40891

Closed
dherman opened this issue Mar 29, 2017 · 2 comments
Closed

error messages for semicolon issues #40891

dherman opened this issue Mar 29, 2017 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@dherman
Copy link
Contributor

dherman commented Mar 29, 2017

When you have a void function that omits a final semicolon or a non-void function that accidentally has a final semicolon, the type error message should be able to be more clever and give you a more helpful "did you mean...?" kind of message.

@dherman
Copy link
Contributor Author

dherman commented Mar 29, 2017

Example of a missing semicolon: https://is.gd/gojgTu

Inline:

fn has_a_side_effect_and_returns_something() -> i32 {
    println!("I am a super useful and awesome side effect");
    42
}

fn do_a_thing() {
    has_a_side_effect_and_returns_something();
    has_a_side_effect_and_returns_something()
}

fn main() {
    do_a_thing();
}

@jdm jdm added the A-diagnostics Area: Messages for errors, warnings, and lints label Apr 1, 2017
@Mark-Simulacrum
Copy link
Member

I'm going to close this in favor of #25228 which is more targeted. Feel free to add or comment there with specific cases!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

3 participants