-
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
freeze type vars after structure is extracted #2262
Comments
nominating this to move up to the "well defined" milestone. I don't entirely understand it but it sounds like a question of clear specification at very least. |
sub-bug of #6834 |
accepted for well-defined milestone |
visiting for triage. nothing to add. |
visiting for triage, it still seems relevant. |
This is no longer relevant, given the new inference strategy wherein we instantiate type variables once and exactly one. |
only one Zulip cron job topic per month
[`useless_vec`]: lint on `vec![_]` invocations that adjust to a slice Fixes rust-lang#2262 (well, actually my PR over at rust-lang#10901 did do most of the stuff, but this PR implements the one last other case mentioned in the comments that my PR didn't fix) Before this change, it would lint `(&vec![1]).iter().sum::<i32>()`, but not `vec![1].iter().sum::<i32>()`. This PR handles this case. This also refactors a few things that I wanted to do in my other PR but forgot about. changelog: [`useless_vec`]: lint on `vec![_]` invocations that adjust to a slice
I'm pretty sure that it is possible for the following things to happen today:
I don't have a specific bad example, but I think it could lead to inconsistencies, perhaps with impl dispatch, perhaps elsewhere. This issue is kind of a note to myself to come up with some examples and make some tests and be sure we're ok. I think what it amounts to is that whenever we do a type-dependent operation, we should go back and assert this type as the upper-bound, so that the type inferencer doesn't come away with a more liberal upper-bound.
Our quite limited subtyping might also make this less relevant.
The text was updated successfully, but these errors were encountered: