-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Typeck highlevel before bodies #24422
Typeck highlevel before bodies #24422
Conversation
…y checks. This avoids various ICEs, e.g. premature calls to cat_expr that yield the dreaded "cat_expr Errd" ICE.
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
} | ||
|
||
impl<T:Get> Other for T { | ||
fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} | ||
//~^ ERROR the trait `Get` is not implemented for the type `(T, U)` | ||
//~| ERROR the trait `Get` is not implemented for the type `(T, U)` |
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.
👍 this PR just for this.
Nice! |
Conceptually, I like this change. I'd rather debug the high-level structural issues first, especially as issues in function bodies may actually just be symptoms of high-level issues. |
r+ I've been thinking about doing exactly this, actually, so happy that you beat me to it. (The other thing I have been considering is adding some kind of rough dependency analysis so we can type-check callees before callers.) |
Note though that we already have the |
@bors r=nikomatsakis |
📌 Commit d82f912 has been approved by |
⌛ Testing commit d82f912 with merge 971440a... |
⛄ The build was interrupted to prioritize another pull request. |
…omatsakis typeck: Do high-level structural/signature checks before function body checks. This avoids various ICEs, e.g. premature calls to cat_expr that yield the dreaded "cat_expr Errd" ICE. However, it also means that some early error feedback is now not provided. This may be for the best, because the error feedback were were providing in some of those cases were false positives -- it was spurious feedback and a distraction from the real problem. So it is not 100% clear whether we actually want to put this change in or not. I think its a net win, but others might disagree. (Kudos to @arielb1 for suggesting this modification.)
normally we would not (should not) accept a change like this for beta, but, since this (1.) fixes ICEs (2.) is a user-experience improvement, and (3.) is pretty low-risk, we are taking it just because 1.0 release is a special case going from nominated to (nominated, accepted) |
typeck: Do high-level structural/signature checks before function body checks.
This avoids various ICEs, e.g. premature calls to cat_expr that yield the dreaded "cat_expr Errd" ICE.
However, it also means that some early error feedback is now not provided. This may be for the best, because the error feedback were were providing in some of those cases were false positives -- it was spurious feedback and a distraction from the real problem.
So it is not 100% clear whether we actually want to put this change in or not. I think its a net win, but others might disagree.
(Kudos to @arielb1 for suggesting this modification.)