-
Notifications
You must be signed in to change notification settings - Fork 13.4k
std: Remove addition on vectors for now #25157
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Ideally this trait implementation would be unstable, requiring crates to opt-in if they would like the functionality, but that's not currently how stability works so the implementation needs to be removed entirely. This may come back at a future date, but for now the conservative option is to remove it. [breaking-change]
r? @gankro (rust_highfive has picked a reviewer for you, use r? to override) |
r=me if you want Might be worth a taskcluster run before sending it to the beta branch. |
Why remove this? |
Because overloading '+' for concatenation is considered a misfeature. '+' is usually reserved for a commutative Operation, which vec concatenation clearly isn't. Removing this undos the wrong precedent and allows us to freely explore the design space. There were a few suggestions for a concatenating operator, so expect this to come back in different form in a future version. |
For better or worse, there's a clear consensus that it's simply too late to make this change (which would need to be made to |
We said we were going to look at the results of the taskcluster / regression report with this PR. Let's stick to the plan? |
Sure, it seems there was a misunderstanding on my part about the consensus here. Reopening. |
Regression report: https://gist.github.com/brson/3455344f4a856d2d21ab |
Is it not a bug to have a Stable method use an Unstable method internally? In this case, I see that |
No, it's not a bug. Implementation details are implementation details. We're free to use unstable APIs to better implement the stable ones. |
So, I'm not sure what conclusions to draw from the regression report. This seems like a fairly small amount of breakage, but I still feel uneasy making breaking changes at this stage. @cmr @sfackler @bluss @alexcrichton, do any of you have strong opinions here? |
With at least 8 crates directly breaking as a result of this change (and possibly more that are hidden in non-root failures) I'm also quite worried about this, and I am much less motivated to push this through. |
I think it looks viable to remove it, just from the test. Of course that only considers Rust-stable crates. The non-stable crates breaking might not be so happy though. |
I say we go for it. |
In particular, the breakage seems limited enough, and we have enough other minor last-minute breakage being back-ported to beta, that on balance this seems OK. Thanks @bluss for helping push this through. |
Ok, exciting. Looking forward to a good discussion about concatenation when the dust after 1.0 settles. |
@bluss: Me too. Thanks @aturon and @alexcrichton for going through with this. |
Ideally this trait implementation would be unstable, requiring crates to opt-in if they would like the functionality, but that's not currently how stability works so the implementation needs to be removed entirely. This may come back at a future date, but for now the conservative option is to remove it. [breaking-change]
@bluss is |
@tshepang Push is just one element, for multiple we have .push_all or .extend which are suboptimal right now. There's an rfc for discussing improvements to extend already. |
Ideally this trait implementation would be unstable, requiring crates to opt-in
if they would like the functionality, but that's not currently how stability
works so the implementation needs to be removed entirely.
This may come back at a future date, but for now the conservative option is to
remove it.
[breaking-change]