Rust 1.21.0
Language
- You can now use static references for literals. Example:
fn main() { let x: &'static u32 = &0; }
- Relaxed path syntax. Optional
::
before<
is now allowed in all contexts. Example:my_macro!(Vec<i32>::new); // Always worked my_macro!(Vec::<i32>::new); // Now works
Compiler
- Upgraded jemalloc to 4.5.0
- Enabled unwinding panics on Redox
- Now runs LLVM in parallel during translation phase. This should reduce peak memory usage.
Libraries
- Generate builtin impls for
Clone
for all arrays and tuples that areT: Clone
Stdin
,Stdout
, andStderr
now implementAsRawFd
.Rc
andArc
now implementFrom<&[T]> where T: Clone
,From<str>
,From<String>
,From<Box<T>> where T: ?Sized
, andFrom<Vec<T>>
.
Stabilized APIs
Cargo
- You can now call
cargo install
with multiple package names - Cargo commands inside a virtual workspace will now implicitly pass
--all
- Added a
[patch]
section toCargo.toml
to handle prepublication dependencies RFC 1969 include
&exclude
fields inCargo.toml
now accept gitignore like patterns- Added the
--all-targets
option - Using required dependencies as a feature is now deprecated and emits a warning
Misc
- Cargo docs are moving to doc.rust-lang.org/cargo
- The rustdoc book is now available at doc.rust-lang.org/rustdoc
- Added a preview of RLS has been made available through rustup Install with
rustup component add rls-preview
std::os
documentation for Unix, Linux, and Windows now appears on doc.rust-lang.org Previously only showedstd::os::unix
.
Compatibility Notes
- Changes in method matching against higher-ranked types This may cause breakage in subtyping corner cases. A more in-depth explanation is available.
- rustc's JSON error output's byte position start at top of file. Was previously relative to the rustc's internal
CodeMap
struct which required the unstable librarylibsyntax
to correctly use. unused_results
lint no longer ignores booleans