Version 1.45.2 (2020-08-03)
Version 1.45.1 (2020-07-30)
- Fix const propagation with references.
- rustfmt accepts rustfmt_skip in cfg_attr again.
- Avoid spurious implicit region bound.
- Install clippy on x.py install
Version 1.45.0 (2020-07-16)
Language
- Out of range float to int conversions using
ashas been defined as a saturating conversion. This was previously undefined behaviour, but you can use the{f64, f32}::to_int_uncheckedmethods to continue using the current behaviour, which may be desirable in rare performance sensitive situations. mem::Discriminant<T>now usesT's discriminant type instead of always usingu64.- Function like procedural macros can now be used in expression, pattern, and statement
positions. This means you can now use a function-like procedural macro
anywhere you can use a declarative (
macro_rules!) macro.
Compiler
- You can now override individual target features through the
target-featureflag. E.g.-C target-feature=+avx2 -C target-feature=+fmais now equivalent to-C target-feature=+avx2,+fma. - Added the
force-unwind-tablesflag. This option allows rustc to always generate unwind tables regardless of panic strategy. - Added the
embed-bitcodeflag. This codegen flag allows rustc to include LLVM bitcode into generatedrlibs (this is on by default). - Added the
tinyvalue to thecode-modelcodegen flag. - Added tier 3 support* for the
mipsel-sony-psptarget. - Added tier 3 support for the
thumbv7a-uwp-windows-msvctarget. - Upgraded to LLVM 10.
* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support.
Libraries
net::{SocketAddr, SocketAddrV4, SocketAddrV6}now implementsPartialOrdandOrd.proc_macro::TokenStreamnow implementsDefault.- You can now use
charwithops::{Range, RangeFrom, RangeFull, RangeInclusive, RangeTo}to iterate over a range of codepoints. E.g. you can now write the following;#![allow(unused)] fn main() { for ch in 'a'..='z' { print!("{}", ch); } println!(); // Prints "abcdefghijklmnopqrstuvwxyz" } OsStringnow implementsFromStr.- The
saturating_negmethod has been added to all signed integer primitive types, and thesaturating_absmethod has been added for all integer primitive types. Arc<T>,Rc<T>now implementFrom<Cow<'_, T>>, andBoxnow implementsFrom<Cow>whenTis[T: Copy],str,CStr,OsStr, orPath.Box<[T]>now implementsFrom<[T; N]>.BitOrandBitOrAssignare implemented for allNonZerointeger types.- The
fetch_min, andfetch_maxmethods have been added to all atomic integer types. - The
fetch_updatemethod has been added to all atomic integer types.
Stabilized APIs
Arc::as_ptrBTreeMap::remove_entryRc::as_ptrrc::Weak::as_ptrrc::Weak::from_rawrc::Weak::into_rawstr::strip_prefixstr::strip_suffixsync::Weak::as_ptrsync::Weak::from_rawsync::Weak::into_rawchar::UNICODE_VERSIONSpan::resolved_atSpan::located_atSpan::mixed_siteunix::process::CommandExt::arg0
Cargo
Misc
- Rustdoc now supports strikethrough text in Markdown. E.g.
~~outdated information~~becomes "outdated information". - Added an emoji to Rustdoc's deprecated API message.
Compatibility Notes
- Trying to self initialize a static value (that is creating a value using itself) is unsound and now causes a compile error.
{f32, f64}::powinow returns a slightly different value on Windows. This is due to changes in LLVM's intrinsics which{f32, f64}::powiuses.- Rustdoc's CLI's extra error exit codes have been removed. These were previously undocumented and not intended for public use. Rustdoc still provides a non-zero exit code on errors.
- Rustc's
ltoflag is incompatible with the newembed-bitcode=no. This may cause issues if LTO is enabled throughRUSTFLAGSorcargo rustcflags while cargo is addingembed-bitcodeitself. The recommended way to control LTO is with Cargo profiles, either inCargo.tomlor.cargo/config, or by settingCARGO_PROFILE_<name>_LTOin the environment.