-
Notifications
You must be signed in to change notification settings - Fork 13.7k
std: Tweak String implementations #20722
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
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
r? @aturon cc @seanmonstar |
ce12834
to
7d79d56
Compare
@@ -806,6 +808,7 @@ impl Default for String { | |||
} | |||
|
|||
#[experimental = "waiting on fmt stabilization"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
double attributes
This commit performs a pass over the implementations of the new `String` trait in the formatting module. Some implementations were removed as a conservative move pending an upcoming convention about `String` implementations, and some were added in order to retain consistency across the libraries. Specifically: * All "smart pointers" implement `String` now, adding missing implementations for `Arc` and `Rc`. * The `Vec<T>` and `[T]` types no longer implement `String`. * The `*const T` and `*mut T` type no longer implement `String`. * The `()` type no longer implements `String`. * The `Path` type's `Show` implementation does not surround itself with `Path {}` (a minor tweak). All implementations of `String` in this PR were also marked `#[stable]` to indicate that the types will continue to implement the `String` trait regardless of what it looks like.
7d79d56
to
9851b4f
Compare
|
||
#[cfg(not(stage0))] | ||
#[experimental = "waiting on Show stability"] | ||
impl<T: fmt::String> fmt::String for Vec<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this was used by rustdoc, to print arguments and generics and the like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or well, the slice version of this.
Conflicts: src/libcollections/vec.rs src/libcore/fmt/mod.rs src/librustdoc/html/format.rs
This commit performs a pass over the implementations of the new
String
traitin the formatting module. Some implementations were removed as a conservative
move pending an upcoming convention about
String
implementations, and somewere added in order to retain consistency across the libraries. Specifically:
String
now, adding missing implementationsfor
Arc
andRc
.Vec<T>
and[T]
types no longer implementString
.*const T
and*mut T
type no longer implementString
.()
type no longer implementsString
.Path
type'sShow
implementation does not surround itself withPath {}
(a minor tweak).