Skip to content

std: Remove addition on vectors for now #25157

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

Merged
merged 1 commit into from
May 7, 2015

Conversation

alexcrichton
Copy link
Member

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]

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]
@rust-highfive
Copy link
Contributor

r? @gankro

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

r? @aturon

cc #25006, @bluss, @bstrie, @llogiq

@rust-highfive rust-highfive assigned aturon and unassigned Gankra May 6, 2015
@alexcrichton alexcrichton added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 6, 2015
@Manishearth
Copy link
Member

r=me if you want

Might be worth a taskcluster run before sending it to the beta branch.

@tshepang
Copy link
Member

tshepang commented May 6, 2015

Why remove this?

@llogiq
Copy link
Contributor

llogiq commented May 6, 2015

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.

@aturon
Copy link
Member

aturon commented May 7, 2015

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 String as well). I'm going to close this PR. Thanks @alexcrichton.

@aturon aturon closed this May 7, 2015
@aturon aturon reopened this May 7, 2015
@aturon aturon closed this May 7, 2015
@bluss
Copy link
Member

bluss commented May 7, 2015

We said we were going to look at the results of the taskcluster / regression report with this PR. Let's stick to the plan?

@aturon
Copy link
Member

aturon commented May 7, 2015

Sure, it seems there was a misunderstanding on my part about the consensus here. Reopening.

@aturon aturon reopened this May 7, 2015
@brson
Copy link
Contributor

brson commented May 7, 2015

Regression report: https://gist.github.com/brson/3455344f4a856d2d21ab

@tshepang
Copy link
Member

tshepang commented May 7, 2015

Is it not a bug to have a Stable method use an Unstable method internally? In this case, I see that push_all is used in the add method.

@Gankra
Copy link
Contributor

Gankra commented May 7, 2015

No, it's not a bug. Implementation details are implementation details. We're free to use unstable APIs to better implement the stable ones.

@aturon
Copy link
Member

aturon commented May 7, 2015

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?

@alexcrichton
Copy link
Member Author

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.

@bluss
Copy link
Member

bluss commented May 7, 2015

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.

@sfackler
Copy link
Member

sfackler commented May 7, 2015

I say we go for it.

@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 7, 2015
@alexcrichton
Copy link
Member Author

We discussed this at triage today and concluded that although this is close to 1.0 it's best to take the conservative route for now, so we're going to move forward on this.

@bors: r=aturon 8d3f84e p=10

@aturon
Copy link
Member

aturon commented May 7, 2015

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.

@bluss
Copy link
Member

bluss commented May 7, 2015

Ok, exciting. Looking forward to a good discussion about concatenation when the dust after 1.0 settles.

@llogiq
Copy link
Contributor

llogiq commented May 7, 2015

@bluss: Me too. Thanks @aturon and @alexcrichton for going through with this.

@bors
Copy link
Collaborator

bors commented May 7, 2015

⌛ Testing commit 8d3f84e with merge 5ae026e...

bors added a commit that referenced this pull request May 7, 2015
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]
@tshepang
Copy link
Member

tshepang commented May 7, 2015

@bluss is push too clunky?

@bluss
Copy link
Member

bluss commented May 7, 2015

@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.

@bors bors merged commit 8d3f84e into rust-lang:master May 7, 2015
@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 8, 2015
@alexcrichton alexcrichton deleted the remove-vec-add branch July 10, 2015 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.