Skip to content

Conversation

alexcrichton
Copy link
Member

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

@rust-highfive
Copy link
Contributor

r? @pcwalton

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

@alexcrichton
Copy link
Member Author

r? @aturon

cc @seanmonstar
cc @wycats

@@ -806,6 +808,7 @@ impl Default for String {
}

#[experimental = "waiting on fmt stabilization"]
Copy link
Contributor

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.

#[cfg(not(stage0))]
#[experimental = "waiting on Show stability"]
impl<T: fmt::String> fmt::String for Vec<T> {
Copy link
Contributor

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.

Copy link
Contributor

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.

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Jan 8, 2015
Conflicts:
	src/libcollections/vec.rs
	src/libcore/fmt/mod.rs
	src/librustdoc/html/format.rs
@bors bors merged commit 9851b4f into rust-lang:master Jan 8, 2015
@alexcrichton alexcrichton deleted the audit-show branch January 20, 2015 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants