Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upiter::Zip is now invariant #35727
Comments
apasel422
added
the
A-libs
label
Aug 16, 2016
This comment has been minimized.
This comment has been minimized.
|
(also a regression from stable to beta) |
apasel422
added
the
regression-from-stable-to-beta
label
Aug 16, 2016
alexcrichton
added
I-nominated
T-libs
labels
Aug 16, 2016
This comment has been minimized.
This comment has been minimized.
|
If this is a beta regression that means it is going to hit stable thursday. |
This comment has been minimized.
This comment has been minimized.
|
If somebody fixed and landed this right now and we started a stable build tonight we might be able to manage getting this into a Thursday release. |
This comment has been minimized.
This comment has been minimized.
|
... or we could just end up flubbing and missing our date. |
frewsxcv
referenced this issue
Aug 16, 2016
Merged
Specialize .zip() for efficient slice and slice iteration #33090
This comment has been minimized.
This comment has been minimized.
|
I don't think this is a serious enough regression to halt the release. @Stebalien this was just manufactured, right? There's no code that actually hit this? |
This comment has been minimized.
This comment has been minimized.
|
@brson. The fix is to either revert the zip specializations (simplest) or put the extra fields needed by specialization into the main @alexcrichton Not my code. |
This comment has been minimized.
This comment has been minimized.
|
Ah this is troublesome, indeed it's the associated types/struct field specialization that causes this, not just the regular "behavioral" specialization isn't it. I can't think of a workaround, we could back out the whole optimization, or just the associated type part? |
This comment has been minimized.
This comment has been minimized.
|
Discussed at @rust-lang/libs triage today, we concluded that we're likely to revert but we're not sure. @aturon wasn't present unfortunately and he'll likely also have opinions on this as well. We'll discuss again soon. Our other conclusion was that this wasn't super urgent because it's already hit stable. |
This comment has been minimized.
This comment has been minimized.
|
cc @nikomatsakis This is a pretty interesting tradeoff -- using specialization on representation destroys any variance. |
This comment has been minimized.
This comment has been minimized.
|
That is an interesting dilemma! I don't see an obvious solution though except maybe for explicit variance annotations on traits (that could then be checked by its implementors). i.e., you could say "all values of |
This comment has been minimized.
This comment has been minimized.
|
@nikomatsakis That pretty much echos my thoughts as well. |
This comment has been minimized.
This comment has been minimized.
|
@aturon there is a general desire for being able to prevent variance regressions (as expressed by e.g. @brson). I had thought about solving this in various ways (including as part of a more general semver checker), but this may tilt the balance in favor of adding some way to declare variance (even if it is optional). |
This comment has been minimized.
This comment has been minimized.
|
Decision at the libs team triage today was that we should revert the specialization of the structure of |
alexcrichton
added
E-help-wanted
and removed
I-nominated
labels
Sep 12, 2016
This comment has been minimized.
This comment has been minimized.
|
Sure. What do you mean by the Fuse strategy? Just no specialization of the data, only the methods? |
This comment has been minimized.
This comment has been minimized.
|
Ah yeah sorry I mean to just specialize the methods, not the struct representation (which we believe fixes this bug) |
Stebalien commentedAug 16, 2016
The following compiles on stable but not beta: