Version 1.35.0 (2019-05-23)
Language
FnOnce
,FnMut
, and theFn
traits are now implemented forBox<FnOnce>
,Box<FnMut>
, andBox<Fn>
respectively.- You can now coerce closures into unsafe function pointers. e.g.
unsafe fn call_unsafe(func: unsafe fn()) { func() } pub fn main() { unsafe { call_unsafe(|| {}); } }
Compiler
- Added the
armv6-unknown-freebsd-gnueabihf
andarmv7-unknown-freebsd-gnueabihf
targets. - Added the
wasm32-unknown-wasi
target.
Libraries
Thread
will now show its ID inDebug
output.StdinLock
,StdoutLock
, andStderrLock
now implementAsRawFd
.alloc::System
now implementsDefault
.- Expanded
Debug
output ({:#?}
) for structs now has a trailing comma on the last field. char::{ToLowercase, ToUppercase}
now implementExactSizeIterator
.- All
NonZero
numeric types now implementFromStr
. - Removed the
Read
trait bounds on theBufReader::{get_ref, get_mut, into_inner}
methods. - You can now call the
dbg!
macro without any parameters to print the file and line where it is called. - In place ASCII case conversions are now up to 4× faster.
e.g.
str::make_ascii_lowercase
hash_map::{OccupiedEntry, VacantEntry}
now implementSync
andSend
.
Stabilized APIs
f32::copysign
f64::copysign
RefCell::replace_with
RefCell::map_split
ptr::hash
Range::contains
RangeFrom::contains
RangeTo::contains
RangeInclusive::contains
RangeToInclusive::contains
Option::copied
Cargo
- You can now set
cargo:rustc-cdylib-link-arg
at build time to pass custom linker arguments when building acdylib
. Its usage is highly platform specific.