-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Regression in integer fallback #21595
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
changing EDIT: Maybe worth noting that these work:
|
That's just a workaround to a bug (not sure if that was implied). |
I don't necessarily expect this to work. Fallback comes late in the process, once all constraints are known, but |
It's plausible we could make it work since we know that the type is integral (I imagine that's how it ever worked, not sure what would have changed that, though it might have been something I did). It occurs to me though that this is somewhat forward-hostile to the idea of integer literals ever being used for anything other than plain ints (but enabling such a feature may well wind up requiring opt-in anyway). |
(Though really it's sort of silly that |
I thought this was a feature because it's saying that it doesn't know if it's EDIT2: ignore the following, my bad
There's no output from |
The new `::ops::Range` has separated implementations for each of the numeric types, while the old `::iter::Range` has one for type `Int`. However, we do not take output bindings into account when selecting traits. So it confuses `typeck` and makes the new range does not work as good as the old one when it comes to type inference. This patch implements `Iterator` for the new range for one type `Int`. This limitation could be lifted, however, if we ever reconsider the output types' role in type inference. Closes rust-lang#21595 Closes rust-lang#21649 Closes rust-lang#21672
The new `::ops::Range` has separated implementations for each of the numeric types, while the old `::iter::Range` has one for type `Int`. However, we do not take output bindings into account when selecting traits. So it confuses `typeck` and makes the new range does not work as good as the old one when it comes to type inference. This patch implements `Iterator` for the new range for one type `Int`. This limitation could be lifted, however, if we ever reconsider the output types' role in type inference. Closes #21595 Closes #21649 Closes #21672
This code compiled fine before 1.0.0-nightly (4be79d6 2015-01-23 16:08:14 +0000):
But with that version, it now gives this error:
The text was updated successfully, but these errors were encountered: