Auto merge of #41643 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #41449, #41509, #41608, #41613, #41636, #41637
- Failed merges:
This commit is contained in:
bors 2017-04-30 05:25:47 +00:00
commit 78f6318136
9 changed files with 430 additions and 531 deletions

View File

@ -949,44 +949,33 @@ Version 1.12.0 (2016-09-29)
Highlights Highlights
---------- ----------
* [`rustc` translates code to LLVM IR via its own "middle" IR (MIR)] * [`rustc` translates code to LLVM IR via its own "middle" IR (MIR)](https://github.com/rust-lang/rust/pull/34096).
(https://github.com/rust-lang/rust/pull/34096).
This translation pass is far simpler than the previous AST->LLVM pass, and This translation pass is far simpler than the previous AST->LLVM pass, and
creates opportunities to perform new optimizations directly on the MIR. It creates opportunities to perform new optimizations directly on the MIR. It
was previously described [on the Rust blog] was previously described [on the Rust blog](https://blog.rust-lang.org/2016/04/19/MIR.html).
(https://blog.rust-lang.org/2016/04/19/MIR.html).
* [`rustc` presents a new, more readable error format, along with * [`rustc` presents a new, more readable error format, along with
machine-readable JSON error output for use by IDEs] machine-readable JSON error output for use by IDEs](https://github.com/rust-lang/rust/pull/35401).
(https://github.com/rust-lang/rust/pull/35401).
Most common editors supporting Rust have been updated to work with it. It was Most common editors supporting Rust have been updated to work with it. It was
previously described [on the Rust blog] previously described [on the Rust blog](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
(https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
Compiler Compiler
-------- --------
* [`rustc` translates code to LLVM IR via its own "middle" IR (MIR)] * [`rustc` translates code to LLVM IR via its own "middle" IR (MIR)](https://github.com/rust-lang/rust/pull/34096).
(https://github.com/rust-lang/rust/pull/34096).
This translation pass is far simpler than the previous AST->LLVM pass, and This translation pass is far simpler than the previous AST->LLVM pass, and
creates opportunities to perform new optimizations directly on the MIR. It creates opportunities to perform new optimizations directly on the MIR. It
was previously described [on the Rust blog] was previously described [on the Rust blog](https://blog.rust-lang.org/2016/04/19/MIR.html).
(https://blog.rust-lang.org/2016/04/19/MIR.html).
* [Print the Rust target name, not the LLVM target name, with * [Print the Rust target name, not the LLVM target name, with
`--print target-list`] `--print target-list`](https://github.com/rust-lang/rust/pull/35489)
(https://github.com/rust-lang/rust/pull/35489)
* [The computation of `TypeId` is correct in some cases where it was previously * [The computation of `TypeId` is correct in some cases where it was previously
producing inconsistent results] producing inconsistent results](https://github.com/rust-lang/rust/pull/35267)
(https://github.com/rust-lang/rust/pull/35267) * [The `mips-unknown-linux-gnu` target uses hardware floating point by default](https://github.com/rust-lang/rust/pull/34910)
* [The `mips-unknown-linux-gnu` target uses hardware floating point by default]
(https://github.com/rust-lang/rust/pull/34910)
* [The `rustc` arguments, `--print target-cpus`, `--print target-features`, * [The `rustc` arguments, `--print target-cpus`, `--print target-features`,
`--print relocation-models`, and `--print code-models` print the available `--print relocation-models`, and `--print code-models` print the available
options to the `-C target-cpu`, `-C target-feature`, `-C relocation-model` and options to the `-C target-cpu`, `-C target-feature`, `-C relocation-model` and
`-C code-model` code generation arguments] `-C code-model` code generation arguments](https://github.com/rust-lang/rust/pull/34845)
(https://github.com/rust-lang/rust/pull/34845)
* [`rustc` supports three new MUSL targets on ARM: `arm-unknown-linux-musleabi`, * [`rustc` supports three new MUSL targets on ARM: `arm-unknown-linux-musleabi`,
`arm-unknown-linux-musleabihf`, and `armv7-unknown-linux-musleabihf`] `arm-unknown-linux-musleabihf`, and `armv7-unknown-linux-musleabihf`](https://github.com/rust-lang/rust/pull/35060).
(https://github.com/rust-lang/rust/pull/35060).
These targets produce statically-linked binaries. There are no binary release These targets produce statically-linked binaries. There are no binary release
builds yet though. builds yet though.
@ -994,209 +983,134 @@ Diagnostics
----------- -----------
* [`rustc` presents a new, more readable error format, along with * [`rustc` presents a new, more readable error format, along with
machine-readable JSON error output for use by IDEs] machine-readable JSON error output for use by IDEs](https://github.com/rust-lang/rust/pull/35401).
(https://github.com/rust-lang/rust/pull/35401).
Most common editors supporting Rust have been updated to work with it. It was Most common editors supporting Rust have been updated to work with it. It was
previously described [on the Rust blog] previously described [on the Rust blog](https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
(https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html).
* [In error descriptions, references are now described in plain English, * [In error descriptions, references are now described in plain English,
instead of as "&-ptr"] instead of as "&-ptr"](https://github.com/rust-lang/rust/pull/35611)
(https://github.com/rust-lang/rust/pull/35611)
* [In error type descriptions, unknown numeric types are named `{integer}` or * [In error type descriptions, unknown numeric types are named `{integer}` or
`{float}` instead of `_`] `{float}` instead of `_`](https://github.com/rust-lang/rust/pull/35080)
(https://github.com/rust-lang/rust/pull/35080) * [`rustc` emits a clearer error when inner attributes follow a doc comment](https://github.com/rust-lang/rust/pull/34676)
* [`rustc` emits a clearer error when inner attributes follow a doc comment]
(https://github.com/rust-lang/rust/pull/34676)
Language Language
-------- --------
* [`macro_rules!` invocations can be made within `macro_rules!` invocations] * [`macro_rules!` invocations can be made within `macro_rules!` invocations](https://github.com/rust-lang/rust/pull/34925)
(https://github.com/rust-lang/rust/pull/34925) * [`macro_rules!` meta-variables are hygienic](https://github.com/rust-lang/rust/pull/35453)
* [`macro_rules!` meta-variables are hygienic]
(https://github.com/rust-lang/rust/pull/35453)
* [`macro_rules!` `tt` matchers can be reparsed correctly, making them much more * [`macro_rules!` `tt` matchers can be reparsed correctly, making them much more
useful] useful](https://github.com/rust-lang/rust/pull/34908)
(https://github.com/rust-lang/rust/pull/34908)
* [`macro_rules!` `stmt` matchers correctly consume the entire contents when * [`macro_rules!` `stmt` matchers correctly consume the entire contents when
inside non-braces invocations] inside non-braces invocations](https://github.com/rust-lang/rust/pull/34886)
(https://github.com/rust-lang/rust/pull/34886)
* [Semicolons are properly required as statement delimeters inside * [Semicolons are properly required as statement delimeters inside
`macro_rules!` invocations] `macro_rules!` invocations](https://github.com/rust-lang/rust/pull/34660)
(https://github.com/rust-lang/rust/pull/34660) * [`cfg_attr` works on `path` attributes](https://github.com/rust-lang/rust/pull/34546)
* [`cfg_attr` works on `path` attributes]
(https://github.com/rust-lang/rust/pull/34546)
Stabilized APIs Stabilized APIs
--------------- ---------------
* [`Cell::as_ptr`] * [`Cell::as_ptr`](https://doc.rust-lang.org/std/cell/struct.Cell.html#method.as_ptr)
(https://doc.rust-lang.org/std/cell/struct.Cell.html#method.as_ptr) * [`RefCell::as_ptr`](https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.as_ptr)
* [`RefCell::as_ptr`] * [`IpAddr::is_unspecified`](https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_unspecified)
(https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.as_ptr) * [`IpAddr::is_loopback`](https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_loopback)
* [`IpAddr::is_unspecified`] * [`IpAddr::is_multicast`](https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_multicast)
(https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_unspecified) * [`Ipv4Addr::is_unspecified`](https://doc.rust-lang.org/std/net/struct.Ipv4Addr.html#method.is_unspecified)
* [`IpAddr::is_loopback`] * [`Ipv6Addr::octets`](https://doc.rust-lang.org/std/net/struct.Ipv6Addr.html#method.octets)
(https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_loopback) * [`LinkedList::contains`](https://doc.rust-lang.org/std/collections/linked_list/struct.LinkedList.html#method.contains)
* [`IpAddr::is_multicast`] * [`VecDeque::contains`](https://doc.rust-lang.org/std/collections/vec_deque/struct.VecDeque.html#method.contains)
(https://doc.rust-lang.org/std/net/enum.IpAddr.html#method.is_multicast) * [`ExitStatusExt::from_raw`](https://doc.rust-lang.org/std/os/unix/process/trait.ExitStatusExt.html#tymethod.from_raw).
* [`Ipv4Addr::is_unspecified`]
(https://doc.rust-lang.org/std/net/struct.Ipv4Addr.html#method.is_unspecified)
* [`Ipv6Addr::octets`]
(https://doc.rust-lang.org/std/net/struct.Ipv6Addr.html#method.octets)
* [`LinkedList::contains`]
(https://doc.rust-lang.org/std/collections/linked_list/struct.LinkedList.html#method.contains)
* [`VecDeque::contains`]
(https://doc.rust-lang.org/std/collections/vec_deque/struct.VecDeque.html#method.contains)
* [`ExitStatusExt::from_raw`]
(https://doc.rust-lang.org/std/os/unix/process/trait.ExitStatusExt.html#tymethod.from_raw).
Both on Unix and Windows. Both on Unix and Windows.
* [`Receiver::recv_timeout`] * [`Receiver::recv_timeout`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver.html#method.recv_timeout)
(https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver.html#method.recv_timeout) * [`RecvTimeoutError`](https://doc.rust-lang.org/std/sync/mpsc/enum.RecvTimeoutError.html)
* [`RecvTimeoutError`] * [`BinaryHeap::peek_mut`](https://doc.rust-lang.org/std/collections/binary_heap/struct.BinaryHeap.html#method.peek_mut)
(https://doc.rust-lang.org/std/sync/mpsc/enum.RecvTimeoutError.html) * [`PeekMut`](https://doc.rust-lang.org/std/collections/binary_heap/struct.PeekMut.html)
* [`BinaryHeap::peek_mut`] * [`iter::Product`](https://doc.rust-lang.org/std/iter/trait.Product.html)
(https://doc.rust-lang.org/std/collections/binary_heap/struct.BinaryHeap.html#method.peek_mut) * [`iter::Sum`](https://doc.rust-lang.org/std/iter/trait.Sum.html)
* [`PeekMut`] * [`OccupiedEntry::remove_entry`](https://doc.rust-lang.org/std/collections/btree_map/struct.OccupiedEntry.html#method.remove_entry)
(https://doc.rust-lang.org/std/collections/binary_heap/struct.PeekMut.html) * [`VacantEntry::into_key`](https://doc.rust-lang.org/std/collections/btree_map/struct.VacantEntry.html#method.into_key)
* [`iter::Product`]
(https://doc.rust-lang.org/std/iter/trait.Product.html)
* [`iter::Sum`]
(https://doc.rust-lang.org/std/iter/trait.Sum.html)
* [`OccupiedEntry::remove_entry`]
(https://doc.rust-lang.org/std/collections/btree_map/struct.OccupiedEntry.html#method.remove_entry)
* [`VacantEntry::into_key`]
(https://doc.rust-lang.org/std/collections/btree_map/struct.VacantEntry.html#method.into_key)
Libraries Libraries
--------- ---------
* [The `format!` macro and friends now allow a single argument to be formatted * [The `format!` macro and friends now allow a single argument to be formatted
in multiple styles] in multiple styles](https://github.com/rust-lang/rust/pull/33642)
(https://github.com/rust-lang/rust/pull/33642)
* [The lifetime bounds on `[T]::binary_search_by` and * [The lifetime bounds on `[T]::binary_search_by` and
`[T]::binary_search_by_key` have been adjusted to be more flexible] `[T]::binary_search_by_key` have been adjusted to be more flexible](https://github.com/rust-lang/rust/pull/34762)
(https://github.com/rust-lang/rust/pull/34762) * [`Option` implements `From` for its contained type](https://github.com/rust-lang/rust/pull/34828)
* [`Option` implements `From` for its contained type] * [`Cell`, `RefCell` and `UnsafeCell` implement `From` for their contained type](https://github.com/rust-lang/rust/pull/35392)
(https://github.com/rust-lang/rust/pull/34828) * [`RwLock` panics if the reader count overflows](https://github.com/rust-lang/rust/pull/35378)
* [`Cell`, `RefCell` and `UnsafeCell` implement `From` for their contained type] * [`vec_deque::Drain`, `hash_map::Drain` and `hash_set::Drain` are covariant](https://github.com/rust-lang/rust/pull/35354)
(https://github.com/rust-lang/rust/pull/35392) * [`vec::Drain` and `binary_heap::Drain` are covariant](https://github.com/rust-lang/rust/pull/34951)
* [`RwLock` panics if the reader count overflows] * [`Cow<str>` implements `FromIterator` for `char`, `&str` and `String`](https://github.com/rust-lang/rust/pull/35064)
(https://github.com/rust-lang/rust/pull/35378) * [Sockets on Linux are correctly closed in subprocesses via `SOCK_CLOEXEC`](https://github.com/rust-lang/rust/pull/34946)
* [`vec_deque::Drain`, `hash_map::Drain` and `hash_set::Drain` are covariant]
(https://github.com/rust-lang/rust/pull/35354)
* [`vec::Drain` and `binary_heap::Drain` are covariant]
(https://github.com/rust-lang/rust/pull/34951)
* [`Cow<str>` implements `FromIterator` for `char`, `&str` and `String`]
(https://github.com/rust-lang/rust/pull/35064)
* [Sockets on Linux are correctly closed in subprocesses via `SOCK_CLOEXEC`]
(https://github.com/rust-lang/rust/pull/34946)
* [`hash_map::Entry`, `hash_map::VacantEntry` and `hash_map::OccupiedEntry` * [`hash_map::Entry`, `hash_map::VacantEntry` and `hash_map::OccupiedEntry`
implement `Debug`] implement `Debug`](https://github.com/rust-lang/rust/pull/34937)
(https://github.com/rust-lang/rust/pull/34937)
* [`btree_map::Entry`, `btree_map::VacantEntry` and `btree_map::OccupiedEntry` * [`btree_map::Entry`, `btree_map::VacantEntry` and `btree_map::OccupiedEntry`
implement `Debug`] implement `Debug`](https://github.com/rust-lang/rust/pull/34885)
(https://github.com/rust-lang/rust/pull/34885) * [`String` implements `AddAssign`](https://github.com/rust-lang/rust/pull/34890)
* [`String` implements `AddAssign`]
(https://github.com/rust-lang/rust/pull/34890)
* [Variadic `extern fn` pointers implement the `Clone`, `PartialEq`, `Eq`, * [Variadic `extern fn` pointers implement the `Clone`, `PartialEq`, `Eq`,
`PartialOrd`, `Ord`, `Hash`, `fmt::Pointer`, and `fmt::Debug` traits] `PartialOrd`, `Ord`, `Hash`, `fmt::Pointer`, and `fmt::Debug` traits](https://github.com/rust-lang/rust/pull/34879)
(https://github.com/rust-lang/rust/pull/34879) * [`FileType` implements `Debug`](https://github.com/rust-lang/rust/pull/34757)
* [`FileType` implements `Debug`] * [References to `Mutex` and `RwLock` are unwind-safe](https://github.com/rust-lang/rust/pull/34756)
(https://github.com/rust-lang/rust/pull/34757)
* [References to `Mutex` and `RwLock` are unwind-safe]
(https://github.com/rust-lang/rust/pull/34756)
* [`mpsc::sync_channel` `Receiver`s return any available message before * [`mpsc::sync_channel` `Receiver`s return any available message before
reporting a disconnect] reporting a disconnect](https://github.com/rust-lang/rust/pull/34731)
(https://github.com/rust-lang/rust/pull/34731) * [Unicode definitions have been updated to 9.0](https://github.com/rust-lang/rust/pull/34599)
* [Unicode definitions have been updated to 9.0] * [`env` iterators implement `DoubleEndedIterator`](https://github.com/rust-lang/rust/pull/33312)
(https://github.com/rust-lang/rust/pull/34599)
* [`env` iterators implement `DoubleEndedIterator`]
(https://github.com/rust-lang/rust/pull/33312)
Cargo Cargo
----- -----
* [Support local mirrors of registries] * [Support local mirrors of registries](https://github.com/rust-lang/cargo/pull/2857)
(https://github.com/rust-lang/cargo/pull/2857) * [Add support for command aliases](https://github.com/rust-lang/cargo/pull/2679)
* [Add support for command aliases] * [Allow `opt-level="s"` / `opt-level="z"` in profile overrides](https://github.com/rust-lang/cargo/pull/3007)
(https://github.com/rust-lang/cargo/pull/2679) * [Make `cargo doc --open --target` work as expected](https://github.com/rust-lang/cargo/pull/2988)
* [Allow `opt-level="s"` / `opt-level="z"` in profile overrides] * [Speed up noop registry updates](https://github.com/rust-lang/cargo/pull/2974)
(https://github.com/rust-lang/cargo/pull/3007) * [Update OpenSSL](https://github.com/rust-lang/cargo/pull/2971)
* [Make `cargo doc --open --target` work as expected] * [Fix `--panic=abort` with plugins](https://github.com/rust-lang/cargo/pull/2954)
(https://github.com/rust-lang/cargo/pull/2988) * [Always pass `-C metadata` to the compiler](https://github.com/rust-lang/cargo/pull/2946)
* [Speed up noop registry updates] * [Fix depending on git repos with workspaces](https://github.com/rust-lang/cargo/pull/2938)
(https://github.com/rust-lang/cargo/pull/2974) * [Add a `--lib` flag to `cargo new`](https://github.com/rust-lang/cargo/pull/2921)
* [Update OpenSSL] * [Add `http.cainfo` for custom certs](https://github.com/rust-lang/cargo/pull/2917)
(https://github.com/rust-lang/cargo/pull/2971) * [Indicate the compilation profile after compiling](https://github.com/rust-lang/cargo/pull/2909)
* [Fix `--panic=abort` with plugins] * [Allow enabling features for dependencies with `--features`](https://github.com/rust-lang/cargo/pull/2876)
(https://github.com/rust-lang/cargo/pull/2954) * [Add `--jobs` flag to `cargo package`](https://github.com/rust-lang/cargo/pull/2867)
* [Always pass `-C metadata` to the compiler] * [Add `--dry-run` to `cargo publish`](https://github.com/rust-lang/cargo/pull/2849)
(https://github.com/rust-lang/cargo/pull/2946) * [Add support for `RUSTDOCFLAGS`](https://github.com/rust-lang/cargo/pull/2794)
* [Fix depending on git repos with workspaces]
(https://github.com/rust-lang/cargo/pull/2938)
* [Add a `--lib` flag to `cargo new`]
(https://github.com/rust-lang/cargo/pull/2921)
* [Add `http.cainfo` for custom certs]
(https://github.com/rust-lang/cargo/pull/2917)
* [Indicate the compilation profile after compiling]
(https://github.com/rust-lang/cargo/pull/2909)
* [Allow enabling features for dependencies with `--features`]
(https://github.com/rust-lang/cargo/pull/2876)
* [Add `--jobs` flag to `cargo package`]
(https://github.com/rust-lang/cargo/pull/2867)
* [Add `--dry-run` to `cargo publish`]
(https://github.com/rust-lang/cargo/pull/2849)
* [Add support for `RUSTDOCFLAGS`]
(https://github.com/rust-lang/cargo/pull/2794)
Performance Performance
----------- -----------
* [`panic::catch_unwind` is more optimized] * [`panic::catch_unwind` is more optimized](https://github.com/rust-lang/rust/pull/35444)
(https://github.com/rust-lang/rust/pull/35444) * [`panic::catch_unwind` no longer accesses thread-local storage on entry](https://github.com/rust-lang/rust/pull/34866)
* [`panic::catch_unwind` no longer accesses thread-local storage on entry]
(https://github.com/rust-lang/rust/pull/34866)
Tooling Tooling
------- -------
* [Test binaries now support a `--test-threads` argument to specify the number * [Test binaries now support a `--test-threads` argument to specify the number
of threads used to run tests, and which acts the same as the of threads used to run tests, and which acts the same as the
`RUST_TEST_THREADS` environment variable] `RUST_TEST_THREADS` environment variable](https://github.com/rust-lang/rust/pull/35414)
(https://github.com/rust-lang/rust/pull/35414) * [The test runner now emits a warning when tests run over 60 seconds](https://github.com/rust-lang/rust/pull/35405)
* [The test runner now emits a warning when tests run over 60 seconds] * [rustdoc: Fix methods in search results](https://github.com/rust-lang/rust/pull/34752)
(https://github.com/rust-lang/rust/pull/35405) * [`rust-lldb` warns about unsupported versions of LLDB](https://github.com/rust-lang/rust/pull/34646)
* [rustdoc: Fix methods in search results]
(https://github.com/rust-lang/rust/pull/34752)
* [`rust-lldb` warns about unsupported versions of LLDB]
(https://github.com/rust-lang/rust/pull/34646)
* [Rust releases now come with source packages that can be installed by rustup * [Rust releases now come with source packages that can be installed by rustup
via `rustup component add rust-src`] via `rustup component add rust-src`](https://github.com/rust-lang/rust/pull/34366).
(https://github.com/rust-lang/rust/pull/34366).
The resulting source code can be used by tools and IDES, located in the The resulting source code can be used by tools and IDES, located in the
sysroot under `lib/rustlib/src`. sysroot under `lib/rustlib/src`.
Misc Misc
---- ----
* [The compiler can now be built against LLVM 3.9] * [The compiler can now be built against LLVM 3.9](https://github.com/rust-lang/rust/pull/35594)
(https://github.com/rust-lang/rust/pull/35594)
* Many minor improvements to the documentation. * Many minor improvements to the documentation.
* [The Rust exception handling "personality" routine is now written in Rust] * [The Rust exception handling "personality" routine is now written in Rust](https://github.com/rust-lang/rust/pull/34832)
(https://github.com/rust-lang/rust/pull/34832)
Compatibility Notes Compatibility Notes
------------------- -------------------
* [When printing Windows `OsStr`s, unpaired surrogate codepoints are escaped * [When printing Windows `OsStr`s, unpaired surrogate codepoints are escaped
with the lowercase format instead of the uppercase] with the lowercase format instead of the uppercase](https://github.com/rust-lang/rust/pull/35084)
(https://github.com/rust-lang/rust/pull/35084)
* [When formatting strings, if "precision" is specified, the "fill", * [When formatting strings, if "precision" is specified, the "fill",
"align" and "width" specifiers are no longer ignored] "align" and "width" specifiers are no longer ignored](https://github.com/rust-lang/rust/pull/34544)
(https://github.com/rust-lang/rust/pull/34544) * [The `Debug` impl for strings no longer escapes all non-ASCII characters](https://github.com/rust-lang/rust/pull/34485)
* [The `Debug` impl for strings no longer escapes all non-ASCII characters]
(https://github.com/rust-lang/rust/pull/34485)
Version 1.11.0 (2016-08-18) Version 1.11.0 (2016-08-18)
@ -1205,142 +1119,92 @@ Version 1.11.0 (2016-08-18)
Language Language
-------- --------
* [`cfg_attr` works on `path` attributes] * [`cfg_attr` works on `path` attributes](https://github.com/rust-lang/rust/pull/34546)
(https://github.com/rust-lang/rust/pull/34546) * [Support nested `cfg_attr` attributes](https://github.com/rust-lang/rust/pull/34216)
* [Support nested `cfg_attr` attributes] * [Allow statement-generating braced macro invocations at the end of blocks](https://github.com/rust-lang/rust/pull/34436)
(https://github.com/rust-lang/rust/pull/34216) * [Macros can be expanded inside of trait definitions](https://github.com/rust-lang/rust/pull/34213)
* [Allow statement-generating braced macro invocations at the end of blocks] * [`#[macro_use]` works properly when it is itself expanded from a macro](https://github.com/rust-lang/rust/pull/34032)
(https://github.com/rust-lang/rust/pull/34436)
* [Macros can be expanded inside of trait definitions]
(https://github.com/rust-lang/rust/pull/34213)
* [`#[macro_use]` works properly when it is itself expanded from a macro]
(https://github.com/rust-lang/rust/pull/34032)
Stabilized APIs Stabilized APIs
--------------- ---------------
* [`BinaryHeap::append`] * [`BinaryHeap::append`](https://doc.rust-lang.org/std/collections/binary_heap/struct.BinaryHeap.html#method.append)
(https://doc.rust-lang.org/std/collections/binary_heap/struct.BinaryHeap.html#method.append) * [`BTreeMap::append`](https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.append)
* [`BTreeMap::append`] * [`BTreeMap::split_off`](https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.split_off)
(https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.append) * [`BTreeSet::append`](https://doc.rust-lang.org/std/collections/btree_set/struct.BTreeSet.html#method.append)
* [`BTreeMap::split_off`] * [`BTreeSet::split_off`](https://doc.rust-lang.org/std/collections/btree_set/struct.BTreeSet.html#method.split_off)
(https://doc.rust-lang.org/std/collections/btree_map/struct.BTreeMap.html#method.split_off) * [`f32::to_degrees`](https://doc.rust-lang.org/std/primitive.f32.html#method.to_degrees)
* [`BTreeSet::append`]
(https://doc.rust-lang.org/std/collections/btree_set/struct.BTreeSet.html#method.append)
* [`BTreeSet::split_off`]
(https://doc.rust-lang.org/std/collections/btree_set/struct.BTreeSet.html#method.split_off)
* [`f32::to_degrees`]
(https://doc.rust-lang.org/std/primitive.f32.html#method.to_degrees)
(in libcore - previously stabilized in libstd) (in libcore - previously stabilized in libstd)
* [`f32::to_radians`] * [`f32::to_radians`](https://doc.rust-lang.org/std/primitive.f32.html#method.to_radians)
(https://doc.rust-lang.org/std/primitive.f32.html#method.to_radians)
(in libcore - previously stabilized in libstd) (in libcore - previously stabilized in libstd)
* [`f64::to_degrees`] * [`f64::to_degrees`](https://doc.rust-lang.org/std/primitive.f64.html#method.to_degrees)
(https://doc.rust-lang.org/std/primitive.f64.html#method.to_degrees)
(in libcore - previously stabilized in libstd) (in libcore - previously stabilized in libstd)
* [`f64::to_radians`] * [`f64::to_radians`](https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians)
(https://doc.rust-lang.org/std/primitive.f64.html#method.to_radians)
(in libcore - previously stabilized in libstd) (in libcore - previously stabilized in libstd)
* [`Iterator::sum`] * [`Iterator::sum`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.sum)
(https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.sum) * [`Iterator::product`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.sum)
* [`Iterator::product`] * [`Cell::get_mut`](https://doc.rust-lang.org/std/cell/struct.Cell.html#method.get_mut)
(https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.sum) * [`RefCell::get_mut`](https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.get_mut)
* [`Cell::get_mut`]
(https://doc.rust-lang.org/std/cell/struct.Cell.html#method.get_mut)
* [`RefCell::get_mut`]
(https://doc.rust-lang.org/std/cell/struct.RefCell.html#method.get_mut)
Libraries Libraries
--------- ---------
* [The `thread_local!` macro supports multiple definitions in a single * [The `thread_local!` macro supports multiple definitions in a single
invocation, and can apply attributes] invocation, and can apply attributes](https://github.com/rust-lang/rust/pull/34077)
(https://github.com/rust-lang/rust/pull/34077) * [`Cow` implements `Default`](https://github.com/rust-lang/rust/pull/34305)
* [`Cow` implements `Default`]
(https://github.com/rust-lang/rust/pull/34305)
* [`Wrapping` implements binary, octal, lower-hex and upper-hex * [`Wrapping` implements binary, octal, lower-hex and upper-hex
`Display` formatting] `Display` formatting](https://github.com/rust-lang/rust/pull/34190)
(https://github.com/rust-lang/rust/pull/34190) * [The range types implement `Hash`](https://github.com/rust-lang/rust/pull/34180)
* [The range types implement `Hash`] * [`lookup_host` ignores unknown address types](https://github.com/rust-lang/rust/pull/34067)
(https://github.com/rust-lang/rust/pull/34180) * [`assert_eq!` accepts a custom error message, like `assert!` does](https://github.com/rust-lang/rust/pull/33976)
* [`lookup_host` ignores unknown address types] * [The main thread is now called "main" instead of "&lt;main&gt;"](https://github.com/rust-lang/rust/pull/33803)
(https://github.com/rust-lang/rust/pull/34067)
* [`assert_eq!` accepts a custom error message, like `assert!` does]
(https://github.com/rust-lang/rust/pull/33976)
* [The main thread is now called "main" instead of "&lt;main&gt;"]
(https://github.com/rust-lang/rust/pull/33803)
Cargo Cargo
----- -----
* [Disallow specifying features of transitive deps] * [Disallow specifying features of transitive deps](https://github.com/rust-lang/cargo/pull/2821)
(https://github.com/rust-lang/cargo/pull/2821) * [Add color support for Windows consoles](https://github.com/rust-lang/cargo/pull/2804)
* [Add color support for Windows consoles] * [Fix `harness = false` on `[lib]` sections](https://github.com/rust-lang/cargo/pull/2795)
(https://github.com/rust-lang/cargo/pull/2804) * [Don't panic when `links` contains a '.'](https://github.com/rust-lang/cargo/pull/2787)
* [Fix `harness = false` on `[lib]` sections] * [Build scripts can emit warnings](https://github.com/rust-lang/cargo/pull/2630),
(https://github.com/rust-lang/cargo/pull/2795)
* [Don't panic when `links` contains a '.']
(https://github.com/rust-lang/cargo/pull/2787)
* [Build scripts can emit warnings]
(https://github.com/rust-lang/cargo/pull/2630),
and `-vv` prints warnings for all crates. and `-vv` prints warnings for all crates.
* [Ignore file locks on OS X NFS mounts] * [Ignore file locks on OS X NFS mounts](https://github.com/rust-lang/cargo/pull/2720)
(https://github.com/rust-lang/cargo/pull/2720) * [Don't warn about `package.metadata` keys](https://github.com/rust-lang/cargo/pull/2668).
* [Don't warn about `package.metadata` keys]
(https://github.com/rust-lang/cargo/pull/2668).
This provides room for expansion by arbitrary tools. This provides room for expansion by arbitrary tools.
* [Add support for cdylib crate types] * [Add support for cdylib crate types](https://github.com/rust-lang/cargo/pull/2741)
(https://github.com/rust-lang/cargo/pull/2741) * [Prevent publishing crates when files are dirty](https://github.com/rust-lang/cargo/pull/2781)
* [Prevent publishing crates when files are dirty] * [Don't fetch all crates on clean](https://github.com/rust-lang/cargo/pull/2704)
(https://github.com/rust-lang/cargo/pull/2781) * [Propagate --color option to rustc](https://github.com/rust-lang/cargo/pull/2779)
* [Don't fetch all crates on clean] * [Fix `cargo doc --open` on Windows](https://github.com/rust-lang/cargo/pull/2780)
(https://github.com/rust-lang/cargo/pull/2704) * [Improve autocompletion](https://github.com/rust-lang/cargo/pull/2772)
* [Propagate --color option to rustc] * [Configure colors of stderr as well as stdout](https://github.com/rust-lang/cargo/pull/2739)
(https://github.com/rust-lang/cargo/pull/2779)
* [Fix `cargo doc --open` on Windows]
(https://github.com/rust-lang/cargo/pull/2780)
* [Improve autocompletion]
(https://github.com/rust-lang/cargo/pull/2772)
* [Configure colors of stderr as well as stdout]
(https://github.com/rust-lang/cargo/pull/2739)
Performance Performance
----------- -----------
* [Caching projections speeds up type check dramatically for some * [Caching projections speeds up type check dramatically for some
workloads] workloads](https://github.com/rust-lang/rust/pull/33816)
(https://github.com/rust-lang/rust/pull/33816) * [The default `HashMap` hasher is SipHash 1-3 instead of SipHash 2-4](https://github.com/rust-lang/rust/pull/33940)
* [The default `HashMap` hasher is SipHash 1-3 instead of SipHash 2-4]
(https://github.com/rust-lang/rust/pull/33940)
This hasher is faster, but is believed to provide sufficient This hasher is faster, but is believed to provide sufficient
protection from collision attacks. protection from collision attacks.
* [Comparison of `Ipv4Addr` is 10x faster] * [Comparison of `Ipv4Addr` is 10x faster](https://github.com/rust-lang/rust/pull/33891)
(https://github.com/rust-lang/rust/pull/33891)
Rustdoc Rustdoc
------- -------
* [Fix empty implementation section on some module pages] * [Fix empty implementation section on some module pages](https://github.com/rust-lang/rust/pull/34536)
(https://github.com/rust-lang/rust/pull/34536) * [Fix inlined renamed reexports in import lists](https://github.com/rust-lang/rust/pull/34479)
* [Fix inlined renamed reexports in import lists] * [Fix search result layout for enum variants and struct fields](https://github.com/rust-lang/rust/pull/34477)
(https://github.com/rust-lang/rust/pull/34479) * [Fix issues with source links to external crates](https://github.com/rust-lang/rust/pull/34387)
* [Fix search result layout for enum variants and struct fields] * [Fix redirect pages for renamed reexports](https://github.com/rust-lang/rust/pull/34245)
(https://github.com/rust-lang/rust/pull/34477)
* [Fix issues with source links to external crates]
(https://github.com/rust-lang/rust/pull/34387)
* [Fix redirect pages for renamed reexports]
(https://github.com/rust-lang/rust/pull/34245)
Tooling Tooling
------- -------
* [rustc is better at finding the MSVC toolchain] * [rustc is better at finding the MSVC toolchain](https://github.com/rust-lang/rust/pull/34492)
(https://github.com/rust-lang/rust/pull/34492)
* [When emitting debug info, rustc emits frame pointers for closures, * [When emitting debug info, rustc emits frame pointers for closures,
shims and glue, as it does for all other functions] shims and glue, as it does for all other functions](https://github.com/rust-lang/rust/pull/33909)
(https://github.com/rust-lang/rust/pull/33909) * [rust-lldb warns about unsupported versions of LLDB](https://github.com/rust-lang/rust/pull/34646)
* [rust-lldb warns about unsupported versions of LLDB]
(https://github.com/rust-lang/rust/pull/34646)
* Many more errors have been given error codes and extended * Many more errors have been given error codes and extended
explanations explanations
* API documentation continues to be improved, with many new examples * API documentation continues to be improved, with many new examples
@ -1349,30 +1213,22 @@ Misc
---- ----
* [rustc no longer hangs when dependencies recursively re-export * [rustc no longer hangs when dependencies recursively re-export
submodules] submodules](https://github.com/rust-lang/rust/pull/34542)
(https://github.com/rust-lang/rust/pull/34542) * [rustc requires LLVM 3.7+](https://github.com/rust-lang/rust/pull/34104)
* [rustc requires LLVM 3.7+]
(https://github.com/rust-lang/rust/pull/34104)
* [The 'How Safe and Unsafe Interact' chapter of The Rustonomicon was * [The 'How Safe and Unsafe Interact' chapter of The Rustonomicon was
rewritten] rewritten](https://github.com/rust-lang/rust/pull/33895)
(https://github.com/rust-lang/rust/pull/33895) * [rustc support 16-bit pointer sizes](https://github.com/rust-lang/rust/pull/33460).
* [rustc support 16-bit pointer sizes]
(https://github.com/rust-lang/rust/pull/33460).
No targets use this yet, but it works toward AVR support. No targets use this yet, but it works toward AVR support.
Compatibility Notes Compatibility Notes
------------------- -------------------
* [`const`s and `static`s may not have unsized types] * [`const`s and `static`s may not have unsized types](https://github.com/rust-lang/rust/pull/34443)
(https://github.com/rust-lang/rust/pull/34443)
* [The new follow-set rules that place restrictions on `macro_rules!` * [The new follow-set rules that place restrictions on `macro_rules!`
in order to ensure syntax forward-compatibility have been enabled] in order to ensure syntax forward-compatibility have been enabled](https://github.com/rust-lang/rust/pull/33982)
(https://github.com/rust-lang/rust/pull/33982) This was an [ammendment to RFC 550](https://github.com/rust-lang/rfcs/pull/1384),
This was an [ammendment to RFC 550]
(https://github.com/rust-lang/rfcs/pull/1384),
and has been a warning since 1.10. and has been a warning since 1.10.
* [`cfg` attribute process has been refactored to fix various bugs] * [`cfg` attribute process has been refactored to fix various bugs](https://github.com/rust-lang/rust/pull/33706).
(https://github.com/rust-lang/rust/pull/33706).
This causes breakage in some corner cases. This causes breakage in some corner cases.
@ -1383,21 +1239,15 @@ Language
-------- --------
* [Allow `concat_idents!` in type positions as well as in expression * [Allow `concat_idents!` in type positions as well as in expression
positions] positions](https://github.com/rust-lang/rust/pull/33735).
(https://github.com/rust-lang/rust/pull/33735). * [`Copy` types are required to have a trivial implementation of `Clone`](https://github.com/rust-lang/rust/pull/33420).
* [`Copy` types are required to have a trivial implementation of `Clone`]
(https://github.com/rust-lang/rust/pull/33420).
[RFC 1521](https://github.com/rust-lang/rfcs/blob/master/text/1521-copy-clone-semantics.md). [RFC 1521](https://github.com/rust-lang/rfcs/blob/master/text/1521-copy-clone-semantics.md).
* [Single-variant enums support the `#[repr(..)]` attribute] * [Single-variant enums support the `#[repr(..)]` attribute](https://github.com/rust-lang/rust/pull/33355).
(https://github.com/rust-lang/rust/pull/33355). * [Fix `#[derive(RustcEncodable)]` in the presence of other `encode` methods](https://github.com/rust-lang/rust/pull/32908).
* [Fix `#[derive(RustcEncodable)]` in the presence of other `encode` methods]
(https://github.com/rust-lang/rust/pull/32908).
* [`panic!` can be converted to a runtime abort with the * [`panic!` can be converted to a runtime abort with the
`-C panic=abort` flag] `-C panic=abort` flag](https://github.com/rust-lang/rust/pull/32900).
(https://github.com/rust-lang/rust/pull/32900).
[RFC 1513](https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md). [RFC 1513](https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md).
* [Add a new crate type, 'cdylib'] * [Add a new crate type, 'cdylib'](https://github.com/rust-lang/rust/pull/33553).
(https://github.com/rust-lang/rust/pull/33553).
cdylibs are dynamic libraries suitable for loading by non-Rust hosts. cdylibs are dynamic libraries suitable for loading by non-Rust hosts.
[RFC 1510](https://github.com/rust-lang/rfcs/blob/master/text/1510-rdylib.md). [RFC 1510](https://github.com/rust-lang/rfcs/blob/master/text/1510-rdylib.md).
Note that Cargo does not yet directly support cdylibs. Note that Cargo does not yet directly support cdylibs.
@ -1411,242 +1261,146 @@ Stabilized APIs
* `os::windows::fs::OpenOptionsExt::attributes` * `os::windows::fs::OpenOptionsExt::attributes`
* `os::windows::fs::OpenOptionsExt::security_qos_flags` * `os::windows::fs::OpenOptionsExt::security_qos_flags`
* `os::unix::fs::OpenOptionsExt::custom_flags` * `os::unix::fs::OpenOptionsExt::custom_flags`
* [`sync::Weak::new`] * [`sync::Weak::new`](http://doc.rust-lang.org/alloc/arc/struct.Weak.html#method.new)
(http://doc.rust-lang.org/alloc/arc/struct.Weak.html#method.new)
* `Default for sync::Weak` * `Default for sync::Weak`
* [`panic::set_hook`] * [`panic::set_hook`](http://doc.rust-lang.org/std/panic/fn.set_hook.html)
(http://doc.rust-lang.org/std/panic/fn.set_hook.html) * [`panic::take_hook`](http://doc.rust-lang.org/std/panic/fn.take_hook.html)
* [`panic::take_hook`] * [`panic::PanicInfo`](http://doc.rust-lang.org/std/panic/struct.PanicInfo.html)
(http://doc.rust-lang.org/std/panic/fn.take_hook.html) * [`panic::PanicInfo::payload`](http://doc.rust-lang.org/std/panic/struct.PanicInfo.html#method.payload)
* [`panic::PanicInfo`] * [`panic::PanicInfo::location`](http://doc.rust-lang.org/std/panic/struct.PanicInfo.html#method.location)
(http://doc.rust-lang.org/std/panic/struct.PanicInfo.html) * [`panic::Location`](http://doc.rust-lang.org/std/panic/struct.Location.html)
* [`panic::PanicInfo::payload`] * [`panic::Location::file`](http://doc.rust-lang.org/std/panic/struct.Location.html#method.file)
(http://doc.rust-lang.org/std/panic/struct.PanicInfo.html#method.payload) * [`panic::Location::line`](http://doc.rust-lang.org/std/panic/struct.Location.html#method.line)
* [`panic::PanicInfo::location`] * [`ffi::CStr::from_bytes_with_nul`](http://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_bytes_with_nul)
(http://doc.rust-lang.org/std/panic/struct.PanicInfo.html#method.location) * [`ffi::CStr::from_bytes_with_nul_unchecked`](http://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_bytes_with_nul_unchecked)
* [`panic::Location`] * [`ffi::FromBytesWithNulError`](http://doc.rust-lang.org/std/ffi/struct.FromBytesWithNulError.html)
(http://doc.rust-lang.org/std/panic/struct.Location.html) * [`fs::Metadata::modified`](http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.modified)
* [`panic::Location::file`] * [`fs::Metadata::accessed`](http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.accessed)
(http://doc.rust-lang.org/std/panic/struct.Location.html#method.file) * [`fs::Metadata::created`](http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.created)
* [`panic::Location::line`]
(http://doc.rust-lang.org/std/panic/struct.Location.html#method.line)
* [`ffi::CStr::from_bytes_with_nul`]
(http://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_bytes_with_nul)
* [`ffi::CStr::from_bytes_with_nul_unchecked`]
(http://doc.rust-lang.org/std/ffi/struct.CStr.html#method.from_bytes_with_nul_unchecked)
* [`ffi::FromBytesWithNulError`]
(http://doc.rust-lang.org/std/ffi/struct.FromBytesWithNulError.html)
* [`fs::Metadata::modified`]
(http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.modified)
* [`fs::Metadata::accessed`]
(http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.accessed)
* [`fs::Metadata::created`]
(http://doc.rust-lang.org/std/fs/struct.Metadata.html#method.created)
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange`
* `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak` * `sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak`
* `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key` * `collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key`
* `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}` * `os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}`
* [`SocketAddr::is_unnamed`] * [`SocketAddr::is_unnamed`](http://doc.rust-lang.org/std/os/unix/net/struct.SocketAddr.html#method.is_unnamed)
(http://doc.rust-lang.org/std/os/unix/net/struct.SocketAddr.html#method.is_unnamed) * [`SocketAddr::as_pathname`](http://doc.rust-lang.org/std/os/unix/net/struct.SocketAddr.html#method.as_pathname)
* [`SocketAddr::as_pathname`] * [`UnixStream::connect`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.connect)
(http://doc.rust-lang.org/std/os/unix/net/struct.SocketAddr.html#method.as_pathname) * [`UnixStream::pair`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.pair)
* [`UnixStream::connect`] * [`UnixStream::try_clone`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.try_clone)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.connect) * [`UnixStream::local_addr`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.local_addr)
* [`UnixStream::pair`] * [`UnixStream::peer_addr`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.peer_addr)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.pair) * [`UnixStream::set_read_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.read_timeout)
* [`UnixStream::try_clone`] * [`UnixStream::set_write_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.write_timeout)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.try_clone) * [`UnixStream::read_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.read_timeout)
* [`UnixStream::local_addr`] * [`UnixStream::write_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.write_timeout)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.local_addr) * [`UnixStream::set_nonblocking`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.set_nonblocking)
* [`UnixStream::peer_addr`] * [`UnixStream::take_error`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.take_error)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.peer_addr) * [`UnixStream::shutdown`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.shutdown)
* [`UnixStream::set_read_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.read_timeout)
* [`UnixStream::set_write_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.write_timeout)
* [`UnixStream::read_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.read_timeout)
* [`UnixStream::write_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.write_timeout)
* [`UnixStream::set_nonblocking`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.set_nonblocking)
* [`UnixStream::take_error`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.take_error)
* [`UnixStream::shutdown`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixStream.html#method.shutdown)
* Read/Write/RawFd impls for `UnixStream` * Read/Write/RawFd impls for `UnixStream`
* [`UnixListener::bind`] * [`UnixListener::bind`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.bind)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.bind) * [`UnixListener::accept`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.accept)
* [`UnixListener::accept`] * [`UnixListener::try_clone`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.try_clone)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.accept) * [`UnixListener::local_addr`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.local_addr)
* [`UnixListener::try_clone`] * [`UnixListener::set_nonblocking`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.set_nonblocking)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.try_clone) * [`UnixListener::take_error`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.take_error)
* [`UnixListener::local_addr`] * [`UnixListener::incoming`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.incoming)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.local_addr)
* [`UnixListener::set_nonblocking`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.set_nonblocking)
* [`UnixListener::take_error`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.take_error)
* [`UnixListener::incoming`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixListener.html#method.incoming)
* RawFd impls for `UnixListener` * RawFd impls for `UnixListener`
* [`UnixDatagram::bind`] * [`UnixDatagram::bind`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.bind)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.bind) * [`UnixDatagram::unbound`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.unbound)
* [`UnixDatagram::unbound`] * [`UnixDatagram::pair`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.pair)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.unbound) * [`UnixDatagram::connect`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.connect)
* [`UnixDatagram::pair`] * [`UnixDatagram::try_clone`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.try_clone)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.pair) * [`UnixDatagram::local_addr`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.local_addr)
* [`UnixDatagram::connect`] * [`UnixDatagram::peer_addr`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.peer_addr)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.connect) * [`UnixDatagram::recv_from`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.recv_from)
* [`UnixDatagram::try_clone`] * [`UnixDatagram::recv`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.recv)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.try_clone) * [`UnixDatagram::send_to`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send_to)
* [`UnixDatagram::local_addr`] * [`UnixDatagram::send`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.local_addr) * [`UnixDatagram::set_read_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_read_timeout)
* [`UnixDatagram::peer_addr`] * [`UnixDatagram::set_write_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_write_timeout)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.peer_addr) * [`UnixDatagram::read_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.read_timeout)
* [`UnixDatagram::recv_from`] * [`UnixDatagram::write_timeout`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.write_timeout)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.recv_from) * [`UnixDatagram::set_nonblocking`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_nonblocking)
* [`UnixDatagram::recv`] * [`UnixDatagram::take_error`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.take_error)
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.recv) * [`UnixDatagram::shutdown`](http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.shutdown)
* [`UnixDatagram::send_to`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send_to)
* [`UnixDatagram::send`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.send)
* [`UnixDatagram::set_read_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_read_timeout)
* [`UnixDatagram::set_write_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_write_timeout)
* [`UnixDatagram::read_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.read_timeout)
* [`UnixDatagram::write_timeout`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.write_timeout)
* [`UnixDatagram::set_nonblocking`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.set_nonblocking)
* [`UnixDatagram::take_error`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.take_error)
* [`UnixDatagram::shutdown`]
(http://doc.rust-lang.org/std/os/unix/net/struct.UnixDatagram.html#method.shutdown)
* RawFd impls for `UnixDatagram` * RawFd impls for `UnixDatagram`
* `{BTree,Hash}Map::values_mut` * `{BTree,Hash}Map::values_mut`
* [`<[_]>::binary_search_by_key`] * [`<[_]>::binary_search_by_key`](http://doc.rust-lang.org/beta/std/primitive.slice.html#method.binary_search_by_key)
(http://doc.rust-lang.org/beta/std/primitive.slice.html#method.binary_search_by_key)
Libraries Libraries
--------- ---------
* [The `abs_sub` method of floats is deprecated] * [The `abs_sub` method of floats is deprecated](https://github.com/rust-lang/rust/pull/33664).
(https://github.com/rust-lang/rust/pull/33664).
The semantics of this minor method are subtle and probably not what The semantics of this minor method are subtle and probably not what
most people want. most people want.
* [Add implementation of Ord for Cell<T> and RefCell<T> where T: Ord] * [Add implementation of Ord for Cell<T> and RefCell<T> where T: Ord](https://github.com/rust-lang/rust/pull/33306).
(https://github.com/rust-lang/rust/pull/33306).
* [On Linux, if `HashMap`s can't be initialized with `getrandom` they * [On Linux, if `HashMap`s can't be initialized with `getrandom` they
will fall back to `/dev/urandom` temporarily to avoid blocking will fall back to `/dev/urandom` temporarily to avoid blocking
during early boot] during early boot](https://github.com/rust-lang/rust/pull/33086).
(https://github.com/rust-lang/rust/pull/33086). * [Implemented negation for wrapping numerals](https://github.com/rust-lang/rust/pull/33067).
* [Implemented negation for wrapping numerals] * [Implement `Clone` for `binary_heap::IntoIter`](https://github.com/rust-lang/rust/pull/33050).
(https://github.com/rust-lang/rust/pull/33067). * [Implement `Display` and `Hash` for `std::num::Wrapping`](https://github.com/rust-lang/rust/pull/33023).
* [Implement `Clone` for `binary_heap::IntoIter`] * [Add `Default` implementation for `&CStr`, `CString`](https://github.com/rust-lang/rust/pull/32990).
(https://github.com/rust-lang/rust/pull/33050). * [Implement `From<Vec<T>>` and `Into<Vec<T>>` for `VecDeque<T>`](https://github.com/rust-lang/rust/pull/32866).
* [Implement `Display` and `Hash` for `std::num::Wrapping`]
(https://github.com/rust-lang/rust/pull/33023).
* [Add `Default` implementation for `&CStr`, `CString`]
(https://github.com/rust-lang/rust/pull/32990).
* [Implement `From<Vec<T>>` and `Into<Vec<T>>` for `VecDeque<T>`]
(https://github.com/rust-lang/rust/pull/32866).
* [Implement `Default` for `UnsafeCell`, `fmt::Error`, `Condvar`, * [Implement `Default` for `UnsafeCell`, `fmt::Error`, `Condvar`,
`Mutex`, `RwLock`] `Mutex`, `RwLock`](https://github.com/rust-lang/rust/pull/32785).
(https://github.com/rust-lang/rust/pull/32785).
Cargo Cargo
----- -----
* [Cargo.toml supports the `profile.*.panic` option] * [Cargo.toml supports the `profile.*.panic` option](https://github.com/rust-lang/cargo/pull/2687).
(https://github.com/rust-lang/cargo/pull/2687).
This controls the runtime behavior of the `panic!` macro This controls the runtime behavior of the `panic!` macro
and can be either "unwind" (the default), or "abort". and can be either "unwind" (the default), or "abort".
[RFC 1513](https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md). [RFC 1513](https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md).
* [Don't throw away errors with `-p` arguments] * [Don't throw away errors with `-p` arguments](https://github.com/rust-lang/cargo/pull/2723).
(https://github.com/rust-lang/cargo/pull/2723). * [Report status to stderr instead of stdout](https://github.com/rust-lang/cargo/pull/2693).
* [Report status to stderr instead of stdout]
(https://github.com/rust-lang/cargo/pull/2693).
* [Build scripts are passed a `CARGO_MANIFEST_LINKS` environment * [Build scripts are passed a `CARGO_MANIFEST_LINKS` environment
variable that corresponds to the `links` field of the manifest] variable that corresponds to the `links` field of the manifest](https://github.com/rust-lang/cargo/pull/2710).
(https://github.com/rust-lang/cargo/pull/2710). * [Ban keywords from crate names](https://github.com/rust-lang/cargo/pull/2707).
* [Ban keywords from crate names] * [Canonicalize `CARGO_HOME` on Windows](https://github.com/rust-lang/cargo/pull/2604).
(https://github.com/rust-lang/cargo/pull/2707). * [Retry network requests](https://github.com/rust-lang/cargo/pull/2396).
* [Canonicalize `CARGO_HOME` on Windows]
(https://github.com/rust-lang/cargo/pull/2604).
* [Retry network requests]
(https://github.com/rust-lang/cargo/pull/2396).
By default they are retried twice, which can be customized with the By default they are retried twice, which can be customized with the
`net.retry` value in `.cargo/config`. `net.retry` value in `.cargo/config`.
* [Don't print extra error info for failing subcommands] * [Don't print extra error info for failing subcommands](https://github.com/rust-lang/cargo/pull/2674).
(https://github.com/rust-lang/cargo/pull/2674). * [Add `--force` flag to `cargo install`](https://github.com/rust-lang/cargo/pull/2405).
* [Add `--force` flag to `cargo install`] * [Don't use `flock` on NFS mounts](https://github.com/rust-lang/cargo/pull/2623).
(https://github.com/rust-lang/cargo/pull/2405). * [Prefer building `cargo install` artifacts in temporary directories](https://github.com/rust-lang/cargo/pull/2610).
* [Don't use `flock` on NFS mounts]
(https://github.com/rust-lang/cargo/pull/2623).
* [Prefer building `cargo install` artifacts in temporary directories]
(https://github.com/rust-lang/cargo/pull/2610).
Makes it possible to install multiple crates in parallel. Makes it possible to install multiple crates in parallel.
* [Add `cargo test --doc`] * [Add `cargo test --doc`](https://github.com/rust-lang/cargo/pull/2578).
(https://github.com/rust-lang/cargo/pull/2578). * [Add `cargo --explain`](https://github.com/rust-lang/cargo/pull/2551).
* [Add `cargo --explain`] * [Don't print warnings when `-q` is passed](https://github.com/rust-lang/cargo/pull/2576).
(https://github.com/rust-lang/cargo/pull/2551). * [Add `cargo doc --lib` and `--bin`](https://github.com/rust-lang/cargo/pull/2577).
* [Don't print warnings when `-q` is passed] * [Don't require build script output to be UTF-8](https://github.com/rust-lang/cargo/pull/2560).
(https://github.com/rust-lang/cargo/pull/2576). * [Correctly attempt multiple git usernames](https://github.com/rust-lang/cargo/pull/2584).
* [Add `cargo doc --lib` and `--bin`]
(https://github.com/rust-lang/cargo/pull/2577).
* [Don't require build script output to be UTF-8]
(https://github.com/rust-lang/cargo/pull/2560).
* [Correctly attempt multiple git usernames]
(https://github.com/rust-lang/cargo/pull/2584).
Performance Performance
----------- -----------
* [rustc memory usage was reduced by refactoring the context used for * [rustc memory usage was reduced by refactoring the context used for
type checking] type checking](https://github.com/rust-lang/rust/pull/33425).
(https://github.com/rust-lang/rust/pull/33425).
* [Speed up creation of `HashMap`s by caching the random keys used * [Speed up creation of `HashMap`s by caching the random keys used
to initialize the hash state] to initialize the hash state](https://github.com/rust-lang/rust/pull/33318).
(https://github.com/rust-lang/rust/pull/33318). * [The `find` implementation for `Chain` iterators is 2x faster](https://github.com/rust-lang/rust/pull/33289).
* [The `find` implementation for `Chain` iterators is 2x faster] * [Trait selection optimizations speed up type checking by 15%](https://github.com/rust-lang/rust/pull/33138).
(https://github.com/rust-lang/rust/pull/33289). * [Efficient trie lookup for boolean Unicode properties](https://github.com/rust-lang/rust/pull/33098).
* [Trait selection optimizations speed up type checking by 15%]
(https://github.com/rust-lang/rust/pull/33138).
* [Efficient trie lookup for boolean Unicode properties]
(https://github.com/rust-lang/rust/pull/33098).
10x faster than the previous lookup tables. 10x faster than the previous lookup tables.
* [Special case `#[derive(Copy, Clone)]` to avoid bloat] * [Special case `#[derive(Copy, Clone)]` to avoid bloat](https://github.com/rust-lang/rust/pull/31414).
(https://github.com/rust-lang/rust/pull/31414).
Usability Usability
--------- ---------
* Many incremental improvements to documentation and rustdoc. * Many incremental improvements to documentation and rustdoc.
* [rustdoc: List blanket trait impls] * [rustdoc: List blanket trait impls](https://github.com/rust-lang/rust/pull/33514).
(https://github.com/rust-lang/rust/pull/33514). * [rustdoc: Clean up ABI rendering](https://github.com/rust-lang/rust/pull/33151).
* [rustdoc: Clean up ABI rendering] * [Indexing with the wrong type produces a more informative error](https://github.com/rust-lang/rust/pull/33401).
(https://github.com/rust-lang/rust/pull/33151). * [Improve diagnostics for constants being used in irrefutable patterns](https://github.com/rust-lang/rust/pull/33406).
* [Indexing with the wrong type produces a more informative error] * [When many method candidates are in scope limit the suggestions to 10](https://github.com/rust-lang/rust/pull/33338).
(https://github.com/rust-lang/rust/pull/33401). * [Remove confusing suggestion when calling a `fn` type](https://github.com/rust-lang/rust/pull/33325).
* [Improve diagnostics for constants being used in irrefutable patterns] * [Do not suggest changing `&mut self` to `&mut mut self`](https://github.com/rust-lang/rust/pull/33319).
(https://github.com/rust-lang/rust/pull/33406).
* [When many method candidates are in scope limit the suggestions to 10]
(https://github.com/rust-lang/rust/pull/33338).
* [Remove confusing suggestion when calling a `fn` type]
(https://github.com/rust-lang/rust/pull/33325).
* [Do not suggest changing `&mut self` to `&mut mut self`]
(https://github.com/rust-lang/rust/pull/33319).
Misc Misc
---- ----
* [Update i686-linux-android features to match Android ABI] * [Update i686-linux-android features to match Android ABI](https://github.com/rust-lang/rust/pull/33651).
(https://github.com/rust-lang/rust/pull/33651). * [Update aarch64-linux-android features to match Android ABI](https://github.com/rust-lang/rust/pull/33500).
* [Update aarch64-linux-android features to match Android ABI]
(https://github.com/rust-lang/rust/pull/33500).
* [`std` no longer prints backtraces on platforms where the running * [`std` no longer prints backtraces on platforms where the running
module must be loaded with `env::current_exe`, which can't be relied module must be loaded with `env::current_exe`, which can't be relied
on](https://github.com/rust-lang/rust/pull/33554). on](https://github.com/rust-lang/rust/pull/33554).
@ -1657,34 +1411,24 @@ Misc
* [The `rust-gdb` and `rust-lldb` scripts are distributed on all * [The `rust-gdb` and `rust-lldb` scripts are distributed on all
Unix platforms](https://github.com/rust-lang/rust/pull/32835). Unix platforms](https://github.com/rust-lang/rust/pull/32835).
* [On Unix the runtime aborts by calling `libc::abort` instead of * [On Unix the runtime aborts by calling `libc::abort` instead of
generating an illegal instruction] generating an illegal instruction](https://github.com/rust-lang/rust/pull/31457).
(https://github.com/rust-lang/rust/pull/31457).
* [Rust is now bootstrapped from the previous release of Rust, * [Rust is now bootstrapped from the previous release of Rust,
instead of a snapshot from an arbitrary commit] instead of a snapshot from an arbitrary commit](https://github.com/rust-lang/rust/pull/32942).
(https://github.com/rust-lang/rust/pull/32942).
Compatibility Notes Compatibility Notes
------------------- -------------------
* [`AtomicBool` is now bool-sized, not word-sized] * [`AtomicBool` is now bool-sized, not word-sized](https://github.com/rust-lang/rust/pull/33579).
(https://github.com/rust-lang/rust/pull/33579).
* [`target_env` for Linux ARM targets is just `gnu`, not * [`target_env` for Linux ARM targets is just `gnu`, not
`gnueabihf`, `gnueabi`, etc] `gnueabihf`, `gnueabi`, etc](https://github.com/rust-lang/rust/pull/33403).
(https://github.com/rust-lang/rust/pull/33403). * [Consistently panic on overflow in `Duration::new`](https://github.com/rust-lang/rust/pull/33072).
* [Consistently panic on overflow in `Duration::new`] * [Change `String::truncate` to panic less](https://github.com/rust-lang/rust/pull/32977).
(https://github.com/rust-lang/rust/pull/33072). * [Add `:block` to the follow set for `:ty` and `:path`](https://github.com/rust-lang/rust/pull/32945).
* [Change `String::truncate` to panic less]
(https://github.com/rust-lang/rust/pull/32977).
* [Add `:block` to the follow set for `:ty` and `:path`]
(https://github.com/rust-lang/rust/pull/32945).
Affects how macros are parsed. Affects how macros are parsed.
* [Fix macro hygiene bug] * [Fix macro hygiene bug](https://github.com/rust-lang/rust/pull/32923).
(https://github.com/rust-lang/rust/pull/32923).
* [Feature-gated attributes on macro-generated macro invocations are * [Feature-gated attributes on macro-generated macro invocations are
now rejected] now rejected](https://github.com/rust-lang/rust/pull/32791).
(https://github.com/rust-lang/rust/pull/32791). * [Suppress fallback and ambiguity errors during type inference](https://github.com/rust-lang/rust/pull/32258).
* [Suppress fallback and ambiguity errors during type inference]
(https://github.com/rust-lang/rust/pull/32258).
This caused some minor changes to type inference. This caused some minor changes to type inference.

View File

@ -577,6 +577,7 @@ pub fn distcheck(build: &Build) {
return return
} }
println!("Distcheck");
let dir = build.out.join("tmp").join("distcheck"); let dir = build.out.join("tmp").join("distcheck");
let _ = fs::remove_dir_all(&dir); let _ = fs::remove_dir_all(&dir);
t!(fs::create_dir_all(&dir)); t!(fs::create_dir_all(&dir));
@ -594,6 +595,26 @@ pub fn distcheck(build: &Build) {
build.run(Command::new(build_helper::make(&build.config.build)) build.run(Command::new(build_helper::make(&build.config.build))
.arg("check") .arg("check")
.current_dir(&dir)); .current_dir(&dir));
// Now make sure that rust-src has all of libstd's dependencies
println!("Distcheck rust-src");
let dir = build.out.join("tmp").join("distcheck-src");
let _ = fs::remove_dir_all(&dir);
t!(fs::create_dir_all(&dir));
let mut cmd = Command::new("tar");
cmd.arg("-xzf")
.arg(dist::rust_src_installer(build))
.arg("--strip-components=1")
.current_dir(&dir);
build.run(&mut cmd);
let toml = dir.join("rust-src/lib/rustlib/src/rust/src/libstd/Cargo.toml");
build.run(Command::new(&build.cargo)
.arg("generate-lockfile")
.arg("--manifest-path")
.arg(&toml)
.current_dir(&dir));
} }
/// Test the build system itself /// Test the build system itself

View File

@ -315,11 +315,18 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) {
t!(fs::remove_dir_all(&image)); t!(fs::remove_dir_all(&image));
} }
/// The path to the complete rustc-src tarball
pub fn rust_src_location(build: &Build) -> PathBuf { pub fn rust_src_location(build: &Build) -> PathBuf {
let plain_name = format!("rustc-{}-src", build.rust_package_vers()); let plain_name = format!("rustc-{}-src", build.rust_package_vers());
distdir(build).join(&format!("{}.tar.gz", plain_name)) distdir(build).join(&format!("{}.tar.gz", plain_name))
} }
/// The path to the rust-src component installer
pub fn rust_src_installer(build: &Build) -> PathBuf {
let name = pkgname(build, "rust-src");
distdir(build).join(&format!("{}.tar.gz", name))
}
/// Creates a tarball of save-analysis metadata, if available. /// Creates a tarball of save-analysis metadata, if available.
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) { pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
assert!(build.config.extended); assert!(build.config.extended);

View File

@ -1604,6 +1604,15 @@ impl FromIterator<String> for String {
} }
} }
#[stable(feature = "herd_cows", since = "1.19.0")]
impl<'a> FromIterator<Cow<'a, str>> for String {
fn from_iter<I: IntoIterator<Item = Cow<'a, str>>>(iter: I) -> String {
let mut buf = String::new();
buf.extend(iter);
buf
}
}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
impl Extend<char> for String { impl Extend<char> for String {
fn extend<I: IntoIterator<Item = char>>(&mut self, iter: I) { fn extend<I: IntoIterator<Item = char>>(&mut self, iter: I) {
@ -1641,6 +1650,15 @@ impl Extend<String> for String {
} }
} }
#[stable(feature = "herd_cows", since = "1.19.0")]
impl<'a> Extend<Cow<'a, str>> for String {
fn extend<I: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: I) {
for s in iter {
self.push_str(&s)
}
}
}
/// A convenience impl that delegates to the impl for `&str` /// A convenience impl that delegates to the impl for `&str`
#[unstable(feature = "pattern", #[unstable(feature = "pattern",
reason = "API not fully fleshed out and ready to be stabilized", reason = "API not fully fleshed out and ready to be stabilized",

View File

@ -13,6 +13,10 @@ mod strategy {
mod grisu; mod grisu;
} }
use std::f64;
use std::io::Write;
use std::vec::Vec;
use test::Bencher;
use core::num::flt2dec::{decode, DecodableFloat, FullDecoded, Decoded}; use core::num::flt2dec::{decode, DecodableFloat, FullDecoded, Decoded};
use core::num::flt2dec::MAX_SIG_DIGITS; use core::num::flt2dec::MAX_SIG_DIGITS;
@ -22,3 +26,23 @@ pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded {
full_decoded => panic!("expected finite, got {:?} instead", full_decoded) full_decoded => panic!("expected finite, got {:?} instead", full_decoded)
} }
} }
#[bench]
fn bench_small_shortest(b: &mut Bencher) {
let mut buf = Vec::with_capacity(20);
b.iter(|| {
buf.clear();
write!(&mut buf, "{}", 3.1415926f64).unwrap()
});
}
#[bench]
fn bench_big_shortest(b: &mut Bencher) {
let mut buf = Vec::with_capacity(300);
b.iter(|| {
buf.clear();
write!(&mut buf, "{}", f64::MAX).unwrap()
});
}

View File

@ -9,8 +9,43 @@
// except according to those terms. // except according to those terms.
use fmt::{Formatter, Result, LowerExp, UpperExp, Display, Debug}; use fmt::{Formatter, Result, LowerExp, UpperExp, Display, Debug};
use mem;
use num::flt2dec; use num::flt2dec;
// Don't inline this so callers don't use the stack space this function
// requires unless they have to.
#[inline(never)]
fn float_to_decimal_common_exact<T>(fmt: &mut Formatter, num: &T,
sign: flt2dec::Sign, precision: usize) -> Result
where T: flt2dec::DecodableFloat
{
unsafe {
let mut buf: [u8; 1024] = mem::uninitialized(); // enough for f32 and f64
let mut parts: [flt2dec::Part; 5] = mem::uninitialized();
let formatted = flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact,
*num, sign, precision,
false, &mut buf, &mut parts);
fmt.pad_formatted_parts(&formatted)
}
}
// Don't inline this so callers that call both this and the above won't wind
// up using the combined stack space of both functions in some cases.
#[inline(never)]
fn float_to_decimal_common_shortest<T>(fmt: &mut Formatter,
num: &T, sign: flt2dec::Sign) -> Result
where T: flt2dec::DecodableFloat
{
unsafe {
// enough for f32 and f64
let mut buf: [u8; flt2dec::MAX_SIG_DIGITS] = mem::uninitialized();
let mut parts: [flt2dec::Part; 5] = mem::uninitialized();
let formatted = flt2dec::to_shortest_str(flt2dec::strategy::grisu::format_shortest,
*num, sign, 0, false, &mut buf, &mut parts);
fmt.pad_formatted_parts(&formatted)
}
}
// Common code of floating point Debug and Display. // Common code of floating point Debug and Display.
fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool) -> Result fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool) -> Result
where T: flt2dec::DecodableFloat where T: flt2dec::DecodableFloat
@ -23,16 +58,48 @@ fn float_to_decimal_common<T>(fmt: &mut Formatter, num: &T, negative_zero: bool)
(true, true) => flt2dec::Sign::MinusPlusRaw, (true, true) => flt2dec::Sign::MinusPlusRaw,
}; };
let mut buf = [0; 1024]; // enough for f32 and f64 if let Some(precision) = fmt.precision {
let mut parts = [flt2dec::Part::Zero(0); 16]; float_to_decimal_common_exact(fmt, num, sign, precision)
let formatted = if let Some(precision) = fmt.precision {
flt2dec::to_exact_fixed_str(flt2dec::strategy::grisu::format_exact, *num, sign,
precision, false, &mut buf, &mut parts)
} else { } else {
flt2dec::to_shortest_str(flt2dec::strategy::grisu::format_shortest, *num, sign, float_to_decimal_common_shortest(fmt, num, sign)
0, false, &mut buf, &mut parts) }
}; }
fmt.pad_formatted_parts(&formatted)
// Don't inline this so callers don't use the stack space this function
// requires unless they have to.
#[inline(never)]
fn float_to_exponential_common_exact<T>(fmt: &mut Formatter, num: &T,
sign: flt2dec::Sign, precision: usize,
upper: bool) -> Result
where T: flt2dec::DecodableFloat
{
unsafe {
let mut buf: [u8; 1024] = mem::uninitialized(); // enough for f32 and f64
let mut parts: [flt2dec::Part; 7] = mem::uninitialized();
let formatted = flt2dec::to_exact_exp_str(flt2dec::strategy::grisu::format_exact,
*num, sign, precision,
upper, &mut buf, &mut parts);
fmt.pad_formatted_parts(&formatted)
}
}
// Don't inline this so callers that call both this and the above won't wind
// up using the combined stack space of both functions in some cases.
#[inline(never)]
fn float_to_exponential_common_shortest<T>(fmt: &mut Formatter,
num: &T, sign: flt2dec::Sign,
upper: bool) -> Result
where T: flt2dec::DecodableFloat
{
unsafe {
// enough for f32 and f64
let mut buf: [u8; flt2dec::MAX_SIG_DIGITS] = mem::uninitialized();
let mut parts: [flt2dec::Part; 7] = mem::uninitialized();
let formatted = flt2dec::to_shortest_exp_str(flt2dec::strategy::grisu::format_shortest,
*num, sign, (0, 0), upper,
&mut buf, &mut parts);
fmt.pad_formatted_parts(&formatted)
}
} }
// Common code of floating point LowerExp and UpperExp. // Common code of floating point LowerExp and UpperExp.
@ -45,17 +112,12 @@ fn float_to_exponential_common<T>(fmt: &mut Formatter, num: &T, upper: bool) ->
true => flt2dec::Sign::MinusPlus, true => flt2dec::Sign::MinusPlus,
}; };
let mut buf = [0; 1024]; // enough for f32 and f64 if let Some(precision) = fmt.precision {
let mut parts = [flt2dec::Part::Zero(0); 16];
let formatted = if let Some(precision) = fmt.precision {
// 1 integral digit + `precision` fractional digits = `precision + 1` total digits // 1 integral digit + `precision` fractional digits = `precision + 1` total digits
flt2dec::to_exact_exp_str(flt2dec::strategy::grisu::format_exact, *num, sign, float_to_exponential_common_exact(fmt, num, sign, precision + 1, upper)
precision + 1, upper, &mut buf, &mut parts)
} else { } else {
flt2dec::to_shortest_exp_str(flt2dec::strategy::grisu::format_shortest, *num, sign, float_to_exponential_common_shortest(fmt, num, sign, upper)
(0, 0), upper, &mut buf, &mut parts) }
};
fmt.pad_formatted_parts(&formatted)
} }
macro_rules! floating { macro_rules! floating {

View File

@ -40,7 +40,7 @@ pub use intrinsics::transmute;
/// `forget` is not marked as `unsafe`, because Rust's safety guarantees /// `forget` is not marked as `unsafe`, because Rust's safety guarantees
/// do not include a guarantee that destructors will always run. For example, /// do not include a guarantee that destructors will always run. For example,
/// a program can create a reference cycle using [`Rc`][rc], or call /// a program can create a reference cycle using [`Rc`][rc], or call
/// [`process:exit`][exit] to exit without running destructors. Thus, allowing /// [`process::exit`][exit] to exit without running destructors. Thus, allowing
/// `mem::forget` from safe code does not fundamentally change Rust's safety /// `mem::forget` from safe code does not fundamentally change Rust's safety
/// guarantees. /// guarantees.
/// ///

View File

@ -283,6 +283,12 @@ fn has_allow_dead_code_or_lang_attr(attrs: &[ast::Attribute]) -> bool {
return true; return true;
} }
// #[used] also keeps the item alive forcefully,
// e.g. for placing it in a specific section.
if attr::contains_name(attrs, "used") {
return true;
}
let dead_code = lint::builtin::DEAD_CODE.name_lower(); let dead_code = lint::builtin::DEAD_CODE.name_lower();
for attr in lint::gather_attrs(attrs) { for attr in lint::gather_attrs(attrs) {
match attr { match attr {

View File

@ -0,0 +1,17 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![deny(dead_code)]
#![feature(used)]
#[used]
static FOO: u32 = 0;
fn main() {}