-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix incorrect type mismatch label pointing at return type #46720
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
aa51b77
to
5ff8a21
Compare
5ff8a21
to
ca2aee4
Compare
This is still wrong in a case such as this: fn main() {
let x = 0;
match x {
_ => {
4 //~ ERROR
}
} // (there's a missing semicolon here)
println!("hi!");
} I would prefer to have a tag on |
This comment has been minimized.
This comment has been minimized.
Reopening as although it is imperfect I want to reduce the incidence of incorrect hints. |
err.span_label(span, "possibly return type missing here?"); | ||
} | ||
(&hir::FunctionRetTy::DefaultReturn(span), _, _) => { | ||
(&hir::FunctionRetTy::DefaultReturn(span), _, false, true) => { | ||
// `fn main()` must return `()`, do not suggest changing return type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is not strictly true anymore -- main
can return other types!
@bors r+ |
📌 Commit 6752a5c has been approved by |
Fix incorrect type mismatch label pointing at return type CC #46302.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
@bors retry |
⌛ Testing commit 6752a5c with merge 73917eb0007c5fce6074abf656bb11e60026fdcc... |
💔 Test failed - status-appveyor |
Legit, UI test not up-to-date.
|
📌 Commit 2636b31 has been approved by |
Fix incorrect type mismatch label pointing at return type CC #46302.
☀️ Test successful - status-appveyor, status-travis |
CC #46302.