-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Lint for functions that don't return but aren't written as "-> !" #12836
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
Comments
It's a decently common idiom to stub out something with things like fn foo() -> Bar {
unimplemented!();
} |
@sfackler: It makes sense for the compiler to warn about a stubbed out function. It's a reminder that you should fix it before making a release. |
Trait impls should be exempted, though, since their types are imposed externally. |
Triage: still an issue ( FYI the updated code is: fn f() -> isize {
panic!("f")
}
fn main() {
f();
} |
@Manishearth does clippy offer this? |
@Toby-s No, but file a bug. Given that there are some common patterns that encourage this, I'd prefer it to be a pedantic lint (off by default) |
Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks! |
…ls, r=y21 feat: `Quick Fix` for `bare URLs` closes rust-lang#12835. *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: [`clippy::doc_markdown`]: `Quick Fix` for `bare URLs`
I think this should warn: f never returns, but it claims to return int.
The text was updated successfully, but these errors were encountered: