-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Make bottom type fallback lazy #22010
Conversation
PR rust-lang#17603 introduced bottom type fallback but did it a bit too eagerly. This patch makes the fallback lazy so that `typeck` can run its cause and detect as many type errors as possible with regard to diverging types. Closes rust-lang#21878
r? @Aatch (rust_highfive has picked a reviewer for you, use r? to override) |
Hmm, I'm not sure how I feel about this. This introduces a "second kind" of fallback. I was planning to start work soon on RFC rust-lang/rfcs#213, which would generalize fallback for integer literals to other type parameters, and part of the reason I felt ok with |
I just did a quick experiment of removing |
And of course, feel free to close this PR if you have something more general in the making. |
@edwardw well what I had in mind is kind of orthogonal to what you've done here. I'm still tossing it about in my mind. |
@nikomatsakis what's your thoughts on this today? |
☔ The latest upstream changes (presumably #26232) made this pull request unmergeable. Please resolve the merge conflicts. |
PR #17603 introduced bottom type fallback but did it a bit too
eagerly. This patch makes the fallback lazy so that
typeck
can runits cause and detect as many type errors as possible with regard to
diverging types.
Closes #21878