Refactor writeback code. cc #5527
Remove error message that refactor suppresses
rustc: Fix enum variant privacy across crates

The code in resolve erroneously assumed that private enums weren't visited, so
the logic was adjusted to check to see if the enum definition itself was public.

Closes #11680
Add testcase for #11493
libsyntax: Remove uses of `~str` from libsyntax, and fix fallout
auto merge of #14032 : pcwalton/rust/detildestr, r=alexcrichton

r? @brson
std: Extract format string parsing out of libstd

This code does not belong in libstd, and rather belongs in a dedicated crate. In
the future, the syntax::ext::format module should move to the fmt_macros crate
(hence the name of the crate), but for now the fmt_macros crate will only
contain the format string parser.

The entire fmt_macros crate is marked #[experimental] because it is not meant
for general consumption, only the format!() interface is officially supported,
not the internals.

This is a breaking change for anyone using the internals of std::fmt::parse.
Some of the flags have moved to std::fmt::rt, while the actual parsing support
has all moved to the fmt_macros library.

[breaking-change]
Remove FromIterator impl for ~[T]

As part of the shift from ~[T] to Vec<T>, recently ~[T] was made
non-growable. However, the FromIterator implementation for ~[T] was left
intact (albeit implemented inefficiently), which basically provided a
loophole to grow a ~[T] despite its non-growable nature. This is a
problem, both for performance reasons and because it encourages APIs to
continue returning ~[T] when they should return Vec<T>. Removing
FromIterator forces these APIs to adopt the correct type.

Furthermore, during today's weekly meeting it was decided that we should
remove all instances of ~[T] from the standard libraries in favor of
Vec<T>. Removing the FromIterator impl makes sense to do as a result.

This commit only includes the removal of the FromIterator impl. The
subsequent commits involve handling all of the breakage that results,
including changing APIs to use Vec<T> instead of ~[T]. The precise API
changes are documented in the subsequent commit messages, but each
commit is not individually marked as a breaking change.

Finally, a new trait FromVec is introduced that provides a mechanism to
convert Vec<T> back into ~[T] if truly necessary. It is a bit awkward to
use by design, and is anticipated that it will be more useful in a
post-DST world to convert to an arbitrary Foo<[T]> smart pointer.

[breaking-change]
Rewrite &[T].to_owned() to allocate directly

This used to create a Vec<T> and then call .move_iter().collect() to
convert to a ~[T]. We can't do that anymore, so construct the ~[T] in
place instead. This has the added benefit of avoiding an unnecessary
memory copy (from the Vec<T> to the ~[T]).
More fallout from removing FromIterator on ~[T]

A few methods in slice that used to return ~[T] now return Vec<T>:

- VectorVector.concat/connect_vec() returns Vec<T>
- slice::unzip() returns (Vec<T>, Vec<U>)
- ImmutableCloneableVector.partitioned() returns (Vec<T>, Vec<T>)
- OwnedVector.partition() returns (Vec<T>, Vec<T>)
Rename slice::unzip() to vec::unzip()

unzip() has nothing to do with slices, so it belongs in vec.
Move slice::raw::from_buf_raw() to vec::raw::from_buf()

Change from_buf_raw() to return a Vec<T> instead of a ~[T]. As such, it
belongs in vec, in the newly-created vec::raw module.
More fallout from removing FromIterator on ~[T]
Even more fallout, this time in std::str

- StrSlice.to_utf16() now returns a Vec<u8>.
- Other miscellaneous fallout in std::str.
Handle fallout in std::strbuf
Handle fallout in std::ascii and std::strconv

API changes:

- OwnedAsciiCast returns Vec<Ascii> instead of ~[Ascii]
- OwnedAsciiCast is implemented on Vec<u8>
- AsciiStr.to_lower/upper() returns Vec<Ascii>
- IntoBytes::into_bytes() returns Vec<u8>
- float_to_str_bytes_common() returns (Vec<u8>, bool)
Handle fallout in iter, option, result, and sync::arc

API changes:

- UnsafeArc::newN() returns Vec<UnsafeArc<T>>
Handle fallout in os

os::env(), os::args(), and related functions now use Vec<T> instead of
~[T].
Handle fallout in io::net::addrinfo, io::process, and rt::rtio

API Changes:

- get_host_addresses() returns IoResult<Vec<IpAddr>>
- Process.extra_io is Vec<Option<io::PipeStream>>
Handle fallout for vector addition

Adding two vectors now results in a Vec<T> instead of a ~[T].

Implement Add on Vec<T>.