implement AddAssign for String#34890
Conversation
|
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
src/libcollections/string.rs
Outdated
| } | ||
| } | ||
|
|
||
| #[stable(feature = "rust1", since = "1.11.0")] |
There was a problem hiding this comment.
This line caused a make tidy error:
different `since` than before
There was a problem hiding this comment.
Ah, what's the right thing to do with these stable annotations in a PR?
There was a problem hiding this comment.
Ah it's ok to pick an arbitrary feature name here, and the since I believe at this point should be 1.12.0
|
cc @rust-lang/libs, seems reasonable to me given that |
src/libcollections/string.rs
Outdated
| } | ||
| } | ||
|
|
||
| #[stable(feature = "rust1", since = "1.12.0")] |
There was a problem hiding this comment.
I think you need to pick a different (arbitrary) feature here.
There was a problem hiding this comment.
Thanks, now I understand what you guys were saying above.
|
sgtm |
|
Libs team discussed and said, 'yeap'. @bors r+ |
|
📌 Commit 9b81306 has been approved by |
|
⌛ Testing commit 9b81306 with merge d87d602... |
|
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
|
@bors: retry On Tue, Jul 19, 2016 at 9:31 PM, bors notifications@github.com wrote:
|
|
@bors: rollup |
|
⌛ Testing commit 9b81306 with merge 4c1a383... |
|
💔 Test failed - auto-linux-64-cargotest |
|
@bors: retry On Wed, Jul 20, 2016 at 6:17 PM, bors notifications@github.com wrote:
|
implement AddAssign for String Currently `String` implements `Add` but not `AddAssign`. This PR fills in that gap. I played around with having `AddAssign` (and `Add` and `push_str`) take `AsRef<str>` instead of `&str`, but it looks like that breaks arguments that implement `Deref<Target=str>` and not `AsRef<str>`. Comments in [`libcore/convert.rs`](https://github.com/rust-lang/rust/blob/master/src/libcore/convert.rs#L207-L213) make it sound like we could fix this with a blanket impl eventually. Does anyone know what's blocking that?
Currently
StringimplementsAddbut notAddAssign. This PR fills in that gap.I played around with having
AddAssign(andAddandpush_str) takeAsRef<str>instead of&str, but it looks like that breaks arguments that implementDeref<Target=str>and notAsRef<str>. Comments inlibcore/convert.rsmake it sound like we could fix this with a blanket impl eventually. Does anyone know what's blocking that?