Version 1.27.2 (2018-07-20)
Compatibility Notes
- The borrow checker was fixed to avoid potential unsoundness when using match ergonomics: #52213.
Version 1.27.1 (2018-07-10)
Security Notes
-
rustdoc would execute plugins in the /tmp/rustdoc/plugins directory when running, which enabled executing code as some other user on a given machine. This release fixes that vulnerability; you can read more about this on the blog. The associated CVE is CVE-2018-1000622.
Thank you to Red Hat for responsibly disclosing this vulnerability to us.
Compatibility Notes
- The borrow checker was fixed to avoid an additional potential unsoundness when using match ergonomics: #51415, #49534.
Version 1.27.0 (2018-06-21)
Language
- Removed 'proc' from the reserved keywords list. This allows
procto be used as an identifier. - The dyn syntax is now available. This syntax is equivalent to the
bare
Traitsyntax, and should make it clearer when being used in tandem withimpl Traitbecause it is equivalent to the following syntax:&Trait == &dyn Trait,&mut Trait == &mut dyn Trait, andBox<Trait> == Box<dyn Trait>. - Attributes on generic parameters such as types and lifetimes are
now stable. 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. It provides a lint that by default warns users when the value returned by a function has not been used.
Compiler
Libraries
- SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable.
This includes
arch::x86&arch::x86_64modules which contain SIMD intrinsics, a new macro calledis_x86_feature_detected!, the#[target_feature(enable="")]attribute, and addingtarget_feature = ""to thecfgattribute. - A lot of methods for
[u8],f32, andf64previously only available in std are now available in core. - The generic
Rhstype parameter onops::{Shl, ShlAssign, Shr}now defaults toSelf. std::str::replacenow has the#[must_use]attribute to clarify that the operation isn't done in place.Clone::clone,Iterator::collect, andToOwned::to_ownednow have the#[must_use]attribute to warn about unused potentially expensive allocations.
Stabilized APIs
DoubleEndedIterator::rfindDoubleEndedIterator::rfoldDoubleEndedIterator::try_rfoldDuration::from_microsDuration::from_nanosDuration::subsec_microsDuration::subsec_millisHashMap::remove_entryIterator::try_foldIterator::try_for_eachNonNull::castOption::filterString::replace_rangeTake::set_limithint::unreachable_uncheckedos::unix::process::parent_idptr::swap_nonoverlappingslice::rsplit_mutslice::rsplitslice::swap_with_slice
Cargo
cargo-metadatanow includesauthors,categories,keywords,readme, andrepositoryfields.cargo-metadatanow includes a package'smetadatatable.- Added the
--target-diroptional argument. This allows you to specify a different directory thantargetfor placing compilation artifacts. - Cargo will be adding automatic target inference for binaries, benchmarks,
examples, and tests in the Rust 2018 edition. 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. This can be disabled by
setting
CARGO_CACHE_RUSTC_INFO=0in your environment.
Misc
- Added “The Rustc book” into the official documentation. “The Rustc book” documents and teaches how to use the rustc compiler.
- All books available on
doc.rust-lang.orgare now searchable.
Compatibility Notes
- Calling a
CharExtorStrExtmethod directly on core will no longer work. e.g.::core::prelude::v1::StrExt::is_empty("")will not compile,"".is_empty()will still compile. Debugoutput onatomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}will only print the inner type. E.g.print!("{:?}", AtomicBool::new(true))will printtrue, notAtomicBool(true).- The maximum number for
repr(align(N))is now 2²⁹. 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 thestd::error::Errortrait has been soft-deprecated. It is no longer required to implement it.