]> git.lizzy.rs Git - rust.git/commit
std: Tweak String implementations
authorAlex Crichton <alex@alexcrichton.com>
Wed, 7 Jan 2015 22:58:31 +0000 (14:58 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 7 Jan 2015 23:24:21 +0000 (15:24 -0800)
commit9851b4fbbf327bb1baab3182ce92970d4db22c6c
treecc315eacedccbe68cc91a8cbf676271dc614153c
parent9f1ead8fadc56bad30dc74f5cc50d78af4fbc972
std: Tweak String implementations

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.
22 files changed:
src/liballoc/arc.rs
src/liballoc/boxed.rs
src/liballoc/rc.rs
src/libcollections/string.rs
src/libcollections/vec.rs
src/libcore/borrow.rs
src/libcore/fmt/mod.rs
src/libcore/option.rs
src/librustdoc/html/format.rs
src/libstd/path/posix.rs
src/libstd/path/windows.rs
src/test/compile-fail/borrowck-borrowed-uniq-rvalue-2.rs
src/test/compile-fail/drop-with-active-borrows-2.rs
src/test/compile-fail/no-capture-arc.rs
src/test/compile-fail/no-reuse-move-arc.rs
src/test/compile-fail/packed-struct-generic-transmute.rs
src/test/run-pass/evec-slice.rs
src/test/run-pass/ifmt.rs
src/test/run-pass/issue-17503.rs
src/test/run-pass/issue-5688.rs
src/test/run-pass/repeated-vector-syntax.rs
src/test/run-pass/vec-to_str.rs