Skip to content

Warn when a never-return function is not written with -> ! #17937

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

Closed
kmcallister opened this issue Oct 11, 2014 · 1 comment
Closed

Warn when a never-return function is not written with -> ! #17937

kmcallister opened this issue Oct 11, 2014 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-type-system Area: Type system

Comments

@kmcallister
Copy link
Contributor

! unifies with any type, so these are both valid:

fn foo() {
    loop { }
}

fn bar() -> uint {
    loop { }
}

Both would be clearer if written as -> !. (But skip this check when implementing trait methods, because their types are externally imposed.)

@kmcallister kmcallister added A-type-system Area: Type system A-diagnostics Area: Messages for errors, warnings, and lints labels Oct 11, 2014
@ghost
Copy link

ghost commented Oct 11, 2014

I'm gonna go ahead and close this in favour of #12836.

@ghost ghost closed this as completed Oct 11, 2014
This issue was closed.
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 A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

1 participant