Rust 1.3.0
Released on September 17, 2015
What's Changed
- The [new object lifetime defaults][nold] have been [turned
- Semicolons may [now follow types and paths in
- The behavior of [
size_of_val][dst1] and [align_of_val][dst2] is 'staticvariables [may now be recursive][st].refbindings choose between [Deref] and [DerefMut]- The
dropckrules, which checks that destructors can't access
- The [
Duration] API, [has been stabilized][ds], as well as the BoxandBox<[T]>both implementClone.- The owned C string, [
CString], implements [Borrow] and the - [
CStr] implements [Debug]. - [
AtomicPtr] implements [Debug]. - [
Error] trait objects [can be downcast to their concrete types][e] - Searching for substrings now [employs the two-way algorithm][search]
- The performance of
PartialEqfor slices is [much faster][ps]. - The [
Hash] trait offers the default method, [hash_slice], which - The [
Hasher] trait now has a number of specializedwrite_* - The I/O-specific error type, [
std::io::Error][ie], gained a set of - [
process::Child][pc] gained the [id] method, which returns a - The [
connect] method on slices is deprecated, replaced by the new - The [
Div] operator is implemented for [Wrapping] types. - [
DerefMutis implemented forString][dms]. - Performance of SipHash (the default hasher for
HashMap) is - [
AtomicPtr] implements [Send]. - The [
read_to_end] implementations for [Stdin] and [File] - Lifetime parameters of foreign functions [are now resolved
- The [new object lifetime defaults][nold] have been [turned
- There is a known [regression][lr] in how object lifetime elision is
- The
#[prelude_import]attribute, an internal implementation - The behavior of [
size_of_val][dst1] and [align_of_val][dst2] is - The
dropckrules, which checks that destructors can't access
- The [new object lifetime defaults][nold] have been [turned
- [The Rustonomicon][nom] is a new book in the official documentation
- The [
Duration] API, [has been stabilized][ds]. This basic unit of - Rust can now, with some coercion, [produce programs that run on
- Porting Rust on Windows from the GNU toolchain to MSVC continues
- On Fedora-based systems installation will [properly configure the
- The compiler gained many new extended error descriptions, which can
- The
dropckpass, which checks that destructors can't access rustcnow uses [LLVM to write archive files where possible][ar].- Rust has [preliminary support for i686 FreeBSD][26959] (it has long
- The [
unused_mut][lum], [unconditional_recursion][lur], - If landing pads are disabled (with
-Z no-landing-pads), [panic!
Full Changelog
* ~900 changes, numerous bugfixes
Highlights
----------
* The [new object lifetime defaults][nold] have been [turned
on][nold2] after a cycle of warnings about the change. Now types
like &'a Box (or &'a Rc, etc) will change from
being interpreted as &'a Box to &'a
Box
* [The Rustonomicon][nom] is a new book in the official documentation
that dives into writing unsafe Rust.
* The [Duration] API, [has been stabilized][ds]. This basic unit of
timekeeping is employed by other std APIs, as well as out-of-tree
time crates.
Breaking Changes
----------------
* The [new object lifetime defaults][nold] have been [turned
on][nold2] after a cycle of warnings about the change.
* There is a known [regression][lr] in how object lifetime elision is
interpreted, the proper solution for which is undetermined.
* The #[prelude_import] attribute, an internal implementation
detail, was accidentally stabilized previously. [It has been put
behind the prelude_import feature gate][pi]. This change is
believed to break no existing code.
* The behavior of [size_of_val][dst1] and [align_of_val][dst2] is
[more sane for dynamically sized types][dst3]. Code that relied on
the previous behavior is thought to be broken.
* The dropck rules, which checks that destructors can't access
destroyed values, [have been updated][dropck] to match the
[RFC][dropckrfc]. This fixes some soundness holes, and as such will
cause some previously-compiling code to no longer build.
Language
--------
* The [new object lifetime defaults][nold] have been [turned
on][nold2] after a cycle of warnings about the change.
* Semicolons may now follow types and paths in
macros.
* The behavior of [size_of_val][dst1] and [align_of_val][dst2] is
[more sane for dynamically sized types][dst3]. Code that relied on
the previous behavior is not known to exist, and suspected to be
broken.
* 'static variables [may now be recursive][st].
* ref bindings choose between [Deref] and [DerefMut]
implementations correctly.
* The dropck rules, which checks that destructors can't access
destroyed values, [have been updated][dropck] to match the
[RFC][dropckrfc].
Libraries
---------
* The [Duration] API, [has been stabilized][ds], as well as the
std::time module, which presently contains only Duration.
* Box and Box<[T]> both implement Clone.
* The owned C string, [CString], implements [Borrow] and the
borrowed C string, [CStr], implements [ToOwned]. The two of
these allow C strings to be borrowed and cloned in generic code.
* [CStr] implements [Debug].
* [AtomicPtr] implements [Debug].
* [Error] trait objects [can be downcast to their concrete types][e]
in many common configurations, using the [is], [downcast],
[downcast_ref] and [downcast_mut] methods, similarly to the
[Any] trait.
* Searching for substrings now [employs the two-way algorithm][search]
instead of doing a naive search. This gives major speedups to a
number of methods, including [contains][sc], [find][sf],
[rfind][srf], [split][ss]. [starts_with][ssw] and
[ends_with][sew] are also faster.
* The performance of PartialEq for slices is [much faster][ps].
* The [Hash] trait offers the default method, [hash_slice], which
is overridden and optimized by the implementations for scalars.
The [Hasher] trait now has a number of specialized write_
methods for primitive types, for efficiency.
* The I/O-specific error type, [std::io::Error][ie], gained a set of
methods for accessing the 'inner error', if any: [get_ref][iegr],
[get_mut][iegm], [into_inner][ieii]. As well, the implementation
of [std::error::Error::cause][iec] also delegates to the inner
error.
* [process::Child][pc] gained the [id] method, which returns a
u32 representing the platform-specific process identifier.
* The [connect] method on slices is deprecated, replaced by the new
[join] method (note that both of these are on the unstable
[SliceConcatExt] trait, but through the magic of the prelude are
available to stable code anyway).
* The [Div] operator is implemented for [Wrapping] types.
* [DerefMut is implemented for String][dms].
* Performance of SipHash (the default hasher for HashMap) is
[better for long data][sh].
* [AtomicPtr] implements [Send].
* The [read_to_end] implementations for [Stdin] and [File]
are now [specialized to use uninitialized buffers for increased
performance][rte].
* Lifetime parameters of foreign functions [are now resolved
properly][f].
Misc
----
* Rust can now, with some coercion, [produce programs that run on
Windows XP][xp], though XP is not considered a supported platform.
* Porting Rust on Windows from the GNU toolchain to MSVC continues
([1][win1], [2][win2], [3][win3], [4][win4]). It is still not
recommended for use in 1.3, though should be fully-functional
in the [64-bit 1.4 beta][b14].
* On Fedora-based systems installation will [properly configure the
dynamic linker][fl].
* The compiler gained many new extended error descriptions, which can
be accessed with the --explain flag.
* The dropck pass, which checks that destructors can't access
destroyed values, [has been rewritten][27261]. This fixes some
soundness holes, and as such will cause some previously-compiling
code to no longer build.
* rustc now uses [LLVM to write archive files where possible][ar].
Eventually this will eliminate the compiler's dependency on the ar
utility.
* Rust has [preliminary support for i686 FreeBSD][26959] (it has long
supported FreeBSD on x86_64).
* The [unused_mut][lum], [unconditional_recursion][lur],
[improper_ctypes][lic], and [negate_unsigned][lnu] lints are
more strict.
* If landing pads are disabled (with -Z no-landing-pads), [panic!
will kill the process instead of leaking][nlp].
[Any]: http://doc.rust-lang.org/nightly/std/any/trait.Any.html
[AtomicPtr]: http://doc.rust-lang.org/nightly/std/sync/atomic/struct.AtomicPtr.html
[Borrow]: http://doc.rust-lang.org/nightly/std/borrow/trait.Borrow.html
[CStr]: http://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html
[CString]: http://doc.rust-lang.org/nightly/std/ffi/struct.CString.html
[Debug]: http://doc.rust-lang.org/nightly/std/fmt/trait.Debug.html
[DerefMut]: http://doc.rust-lang.org/nightly/std/ops/trait.DerefMut.html
[Deref]: http://doc.rust-lang.org/nightly/std/ops/trait.Deref.html
[Div]: http://doc.rust-lang.org/nightly/std/ops/trait.Div.html
[Duration]: http://doc.rust-lang.org/nightly/std/time/struct.Duration.html
[Error]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html
[File]: http://doc.rust-lang.org/nightly/std/fs/struct.File.html
[Hash]: http://doc.rust-lang.org/nightly/std/hash/trait.Hash.html
[Hasher]: http://doc.rust-lang.org/nightly/std/hash/trait.Hasher.html
[Send]: http://doc.rust-lang.org/nightly/std/marker/trait.Send.html
[SliceConcatExt]: http://doc.rust-lang.org/nightly/std/slice/trait.SliceConcatExt.html
[Stdin]: http://doc.rust-lang.org/nightly/std/io/struct.Stdin.html
[ToOwned]: http://doc.rust-lang.org/nightly/std/borrow/trait.ToOwned.html
[Wrapping]: http://doc.rust-lang.org/nightly/std/num/struct.Wrapping.html
[connect]: http://doc.rust-lang.org/nightly/std/slice/trait.SliceConcatExt.html#method.connect
[downcast_mut]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.downcast_mut
[downcast_ref]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.downcast_ref
[downcast]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.downcast
[hash_slice]: http://doc.rust-lang.org/nightly/std/hash/trait.Hash.html#method.hash_slice
[id]: http://doc.rust-lang.org/nightly/std/process/struct.Child.html#method.id
[is]: http://doc.rust-lang.org/nightly/std/error/trait.Error.html#method.is
[join]: http://doc.rust-lang.org/nightly/std/slice/trait.SliceConcatExt.html#method.join
[read_to_end]: http://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_to_end
[ar]: https://github.com/rust-lang/rust/pull/26926
[b14]: https://static.rust-lang.org/dist/rust-beta-x86_64-pc-windows-msvc.msi
[dms]: https://github.com/rust-lang/rust/pull/26241
[27261]: https://github.com/rust-lang/rust/pull/27261
[dropckrfc]: https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md
[ds]: https://github.com/rust-lang/rust/pull/26818
[dst1]: http://doc.rust-lang.org/nightly/std/mem/fn.size_of_val.html
[dst2]: http://doc.rust-lang.org/nightly/std/mem/fn.align_of_val.html
[dst3]: https://github.com/rust-lang/rust/pull/27351
[e]: https://github.com/rust-lang/rust/pull/24793
[f]: https://github.com/rust-lang/rust/pull/26588
[26959]: https://github.com/rust-lang/rust/pull/26959
[fl]: https://github.com/rust-lang/rust-installer/pull/41
[ie]: http://doc.rust-lang.org/nightly/std/io/struct.Error.html
[iec]: http://doc.rust-lang.org/nightly/std/io/struct.Error.html#method.cause
[iegm]: http://doc.rust-lang.org/nightly/std/io/struct.Error.html#method.get_mut
[iegr]: http://doc.rust-lang.org/nightly/std/io/struct.Error.html#method.get_ref
[ieii]: http://doc.rust-lang.org/nightly/std/io/struct.Error.html#method.into_inner
[lic]: https://github.com/rust-lang/rust/pull/26583
[lnu]: https://github.com/rust-lang/rust/pull/27026
[lr]: https://github.com/rust-lang/rust/issues/27248
[lum]: https://github.com/rust-lang/rust/pull/26378
[lur]: https://github.com/rust-lang/rust/pull/26783
[nlp]: https://github.com/rust-lang/rust/pull/27176
[nold2]: https://github.com/rust-lang/rust/pull/27045
[nold]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md
[nom]: http://doc.rust-lang.org/nightly/nomicon/
[pc]: http://doc.rust-lang.org/nightly/std/process/struct.Child.html
[pi]: https://github.com/rust-lang/rust/pull/26699
[ps]: https://github.com/rust-lang/rust/pull/26884
[rte]: https://github.com/rust-lang/rust/pull/26950
[sc]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.contains
[search]: https://github.com/rust-lang/rust/pull/26327
[sew]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.ends_with
[sf]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.find
[sh]: https://github.com/rust-lang/rust/pull/27280
[srf]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.rfind
[ss]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split
[ssw]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.starts_with
[st]: https://github.com/rust-lang/rust/pull/26630
[win1]: https://github.com/rust-lang/rust/pull/26569
[win2]: https://github.com/rust-lang/rust/pull/26741
[win3]: https://github.com/rust-lang/rust/pull/26741
[win4]: https://github.com/rust-lang/rust/pull/27210
[xp]: https://github.com/rust-lang/rust/pull/26569