← Back to all releases

Rust 1.27.0

Released on June 21, 2018

What's Changed

  • [Removed 'proc' from the reserved keywords list.][49699] This allows proc to
  • [The dyn syntax is now available.][49968] This syntax is equivalent to the
  • [Attributes on generic parameters such as types and lifetimes are
  • [The #[must_use] attribute can now also be used on functions as well as

  • [Added the armv5te-unknown-linux-musleabi target.][50423]

  • [SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable.][49664]
  • [A lot of methods for [u8], f32, and f64 previously only available in
  • [The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults
  • [std::str::replace now has the #[must_use] attribute][50177] to clarify
  • [Clone::clone, Iterator::collect, and ToOwned::to_owned now have
  • [DoubleEndedIterator::rfind]
  • [DoubleEndedIterator::rfold]
  • [DoubleEndedIterator::try_rfold]
  • [Duration::from_micros]
  • [Duration::from_nanos]
  • [Duration::subsec_micros]
  • [Duration::subsec_millis]
  • [HashMap::remove_entry]
  • [Iterator::try_fold]
  • [Iterator::try_for_each]
  • [NonNull::cast]
  • [Option::filter]
  • [String::replace_range]
  • [Take::set_limit]
  • [hint::unreachable_unchecked]
  • [os::unix::process::parent_id]
  • [ptr::swap_nonoverlapping]
  • [slice::rsplit_mut]
  • [slice::rsplit]
  • [slice::swap_with_slice]

  • [cargo-metadata now includes authors, categories, keywords,
  • [cargo-metadata now includes a package's metadata table.][cargo/5360]
  • [Added the --target-dir optional argument.][cargo/5393] This allows you to specify
  • [Cargo will be adding automatic target inference for binaries, benchmarks,
  • [Cargo will now cache compiler information.][cargo/5359] This can be disabled by

  • [Calling a CharExt or StrExt method directly on core will no longer
  • [Debug output on atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}
  • [The maximum number for repr(align(N)) is now 2²⁹.][50378] Previously you
  • The .description() method on the std::error::Error trait

  • [Added “The Rustc book” into the official documentation.][49707]
  • [All books available on doc.rust-lang.org are now searchable.][49623]
Full Changelog

Language

--------

- [Removed 'proc' from the reserved keywords list.][49699] This allows proc to

be used as an identifier.

- [The dyn syntax is now available.][49968] This syntax is equivalent to the

bare Trait syntax, and should make it clearer when being used in tandem with

impl Trait because it is equivalent to the following syntax: &Trait == &dyn Trait, &mut Trait == &mut dyn Trait, and Box == Box.

- [Attributes on generic parameters such as types and lifetimes are

now stable.][48851] e.g.

fn foo<#[lifetime_attr] 'a, #[type_attr] T: 'a>() {}

- [The #[must_use] attribute can now also be used on functions as well as

types.][48925] It provides a lint that by default warns users when the

value returned by a function has not been used.

Compiler

--------

- [Added the armv5te-unknown-linux-musleabi target.][50423]

Libraries

---------

- [SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable.][49664]

This includes [arch::x86] & [arch::x86_64] modules which contain

SIMD intrinsics, a new macro called is_x86_feature_detected!, the

#[target_feature(enable="")] attribute, and adding target_feature = "" to

the cfg attribute.

- [A lot of methods for [u8], f32, and f64 previously only available in

std are now available in core.][49896]

- [The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults

to Self.][49630]

- [std::str::replace now has the #[must_use] attribute][50177] to clarify

that the operation isn't done in place.

- [Clone::clone, Iterator::collect, and ToOwned::to_owned now have

the #[must_use] attribute][49533] to warn about unused potentially

expensive allocations.

Stabilized APIs

---------------

- [DoubleEndedIterator::rfind]

- [DoubleEndedIterator::rfold]

- [DoubleEndedIterator::try_rfold]

- [Duration::from_micros]

- [Duration::from_nanos]

- [Duration::subsec_micros]

- [Duration::subsec_millis]

- [HashMap::remove_entry]

- [Iterator::try_fold]

- [Iterator::try_for_each]

- [NonNull::cast]

- [Option::filter]

- [String::replace_range]

- [Take::set_limit]

- [hint::unreachable_unchecked]

- [os::unix::process::parent_id]

- [ptr::swap_nonoverlapping]

- [slice::rsplit_mut]

- [slice::rsplit]

- [slice::swap_with_slice]

Cargo

-----

- [cargo-metadata now includes authors, categories, keywords,

readme, and repository fields.][cargo/5386]

- [cargo-metadata now includes a package's metadata table.][cargo/5360]

- [Added the --target-dir optional argument.][cargo/5393] This allows you to specify

a different directory than target for placing compilation artifacts.

- [Cargo will be adding automatic target inference for binaries, benchmarks,

examples, and tests in the Rust 2018 edition.][cargo/5335] If your project specifies

specific targets, e.g. using [[bin]], and have other binaries in locations

where cargo would infer a binary, Cargo will produce a warning. You can

disable this feature ahead of time by setting any of the following to false:

autobins, autobenches, autoexamples, autotests.

- [Cargo will now cache compiler information.][cargo/5359] This can be disabled by

setting CARGO_CACHE_RUSTC_INFO=0 in your environment.

Misc

----

- [Added “The Rustc book” into the official documentation.][49707]

[“The Rustc book”] documents and teaches how to use the rustc compiler.

- [All books available on doc.rust-lang.org are now searchable.][49623]

Compatibility Notes

-------------------

- [Calling a CharExt or StrExt method directly on core will no longer

work.][49896] e.g. ::core::prelude::v1::StrExt::is_empty("") will not

compile, "".is_empty() will still compile.

- [Debug output on atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}

will only print the inner type.][48553] E.g.

print!("{:?}", AtomicBool::new(true)) will print true,

not AtomicBool(true).

- [The maximum number for repr(align(N)) is now 2²⁹.][50378] Previously you

could enter higher numbers but they were not supported by LLVM. Up to 512MB

alignment should cover all use cases.

- The .description() method on the std::error::Error trait

[has been soft-deprecated][50163]. It is no longer required to implement it.

[48553]: https://github.com/rust-lang/rust/pull/48553/

[48851]: https://github.com/rust-lang/rust/pull/48851/

[48925]: https://github.com/rust-lang/rust/pull/48925/

[49533]: https://github.com/rust-lang/rust/pull/49533/

[49623]: https://github.com/rust-lang/rust/pull/49623/

[49630]: https://github.com/rust-lang/rust/pull/49630/

[49664]: https://github.com/rust-lang/rust/pull/49664/

[49699]: https://github.com/rust-lang/rust/pull/49699/

[49707]: https://github.com/rust-lang/rust/pull/49707/

[49896]: https://github.com/rust-lang/rust/pull/49896/

[49968]: https://github.com/rust-lang/rust/pull/49968/

[50163]: https://github.com/rust-lang/rust/pull/50163

[50177]: https://github.com/rust-lang/rust/pull/50177/

[50378]: https://github.com/rust-lang/rust/pull/50378/

[50423]: https://github.com/rust-lang/rust/pull/50423/

[cargo/5335]: https://github.com/rust-lang/cargo/pull/5335/

[cargo/5359]: https://github.com/rust-lang/cargo/pull/5359/

[cargo/5360]: https://github.com/rust-lang/cargo/pull/5360/

[cargo/5386]: https://github.com/rust-lang/cargo/pull/5386/

[cargo/5393]: https://github.com/rust-lang/cargo/pull/5393/

[DoubleEndedIterator::rfind]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.rfind

[DoubleEndedIterator::rfold]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.rfold

[DoubleEndedIterator::try_rfold]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.try_rfold

[Duration::from_micros]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_micros

[Duration::from_nanos]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.from_nanos

[Duration::subsec_micros]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.subsec_micros

[Duration::subsec_millis]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.subsec_millis

[HashMap::remove_entry]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.remove_entry

[Iterator::try_fold]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_fold

[Iterator::try_for_each]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.try_for_each

[NonNull::cast]: https://doc.rust-lang.org/std/ptr/struct.NonNull.html#method.cast

[Option::filter]: https://doc.rust-lang.org/std/option/enum.Option.html#method.filter

[String::replace_range]: https://doc.rust-lang.org/std/string/struct.String.html#method.replace_range

[Take::set_limit]: https://doc.rust-lang.org/std/io/struct.Take.html#method.set_limit

[hint::unreachable_unchecked]: https://doc.rust-lang.org/std/hint/fn.unreachable_unchecked.html

[os::unix::process::parent_id]: https://doc.rust-lang.org/std/os/unix/process/fn.parent_id.html

[process::id]: https://doc.rust-lang.org/std/process/fn.id.html

[ptr::swap_nonoverlapping]: https://doc.rust-lang.org/std/ptr/fn.swap_nonoverlapping.html

[slice::rsplit_mut]: https://doc.rust-lang.org/std/primitive.slice.html#method.rsplit_mut

[slice::rsplit]: https://doc.rust-lang.org/std/primitive.slice.html#method.rsplit

[slice::swap_with_slice]: https://doc.rust-lang.org/std/primitive.slice.html#method.swap_with_slice

[arch::x86_64]: https://doc.rust-lang.org/std/arch/x86_64/index.html

[arch::x86]: https://doc.rust-lang.org/std/arch/x86/index.html

[“The Rustc book”]: https://doc.rust-lang.org/rustc