-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Regression around Trait::method -> Self
#18209
Comments
cc me |
This is a weird bug: here is a minimal test case:
but, replace |
And calling |
The regressing patch seems to be ce342f5. Which is ... impossible? It only touches files in trans and has nothing to do with type inference. But, I have triple checked this - it really seems to be this commit which regresses the reduced test case. |
And of course patching without that commit does not fix things, so I was right about it being impossible. Now I am just confused about my bisection. |
OK, now I actually have a sensible candidate: 2c0f876 |
This is probably a dup of #18187 |
So, this (https://github.com/nick29581/rust/compare/rust-lang:master...nick29581:infer-bug?expand=1) fixes the problem, but I suspect it is not the right fix. I imagine the |
Interesting, I'll look. |
OK, so, what's happening is this:
This is why the bug goes away when you remove the definition. It would also go away if there were at most one impl. I'm debating what the best fix is. Clearly, when the result is due to a where clause, we should place the result in the local cache. That would fix the problem. I could also imagine that we might not want to employ a where clause when there are inference variables -- but then again, why not? If there are no impls, it's the only plausible way to resolve this trait obligation. |
…es in scope. Fixes rust-lang#18209.
I have this trait definition:
And this usage:
And I get this error upon compilation:
This was compiling recently (I believe last week), but does not compile with today's nightly.
The text was updated successfully, but these errors were encountered: