Original at: https://github.com/rust-lang/rust/blob/master/RELEASES.md
Unique pointers, unique closures, move semantics
Interface-constrained generics
Static interface dispatch
Stack growth
Multithread task scheduling
Typestate predicates
Failure unwinding, destructors
Pattern matching and destructuring assignment
Lightweight block-lambda syntax
Preliminary macro-by-example
Linux: x86 and x86_64 hosts and targets
macOS: x86 and x86_64 hosts and targets
Windows: x86 hosts and targets
Cross compilation / multi-target configuration supported.
Preliminary API-documentation and package-management tools included.
Documentation is incomplete.
Performance is below intended target.
Standard library APIs are subject to extensive change, reorganization.
Language-level versioning is not yet operational - future code will break unexpectedly.
>1500 changes, numerous bugfixes
New docs and doc tooling
New port: FreeBSD x86_64
Generics now specialized, multiply instantiated
Functions now inlined across separate crates
Noticeably improved message-passing performance
Explicit schedulers
Callbacks from C
Helgrind clean
Operator overloading
Region pointers
Classes
C-callback function types: 'crust fn ...'
Infinite-loop construct: 'loop { ... }'
Shorten 'mutable' to 'mut'
Required mutable-local qualifier: 'let mut ...'
Basic glob-exporting: 'export foo::*;'
Alt now exhaustive, 'alt check' for runtime-checked
Block-function form of 'for' loop, with 'break' and 'ret'.
AST quasi-quote syntax extension
Revived libuv interface
New modules: core::{future, iter}, std::arena
Merged per-platform std::{os*, fs*} to core::{libc, os}
Extensive cleanup, regularization in libstd, libcore
~1900 changes, numerous bugfixes
Integer-literal suffix inference
Per-item control over warnings, errors
#[cfg(windows)] and #[cfg(unix)] attributes
Documentation comments
More compact closure syntax
'do' expressions for treating higher-order functions as control structures
*-patterns (wildcard extended to all constructor fields)
Name resolution pass and exhaustiveness checker rewritten
Region pointers and borrow checking supersede alias analysis
Init-ness checking is now provided by a region-based liveness pass instead of the typestate pass; same for last-use analysis
Extensive work on region pointers
Slices and fixed-size, interior-allocated vectors
#!-comments for lang versioning, shell execution
Destructors and iface implementation for classes; type-parameterized classes and class methods
'const' type kind for types that can be used to implement shared-memory concurrency patterns
Keywords: 'be', 'prove', 'syntax', 'note', 'mutable', 'bind', 'crust', 'native' (now 'extern'), 'cont' (now 'again')
Constructs: do-while loops ('do' repurposed), fn binding, resources (replaced by destructors)
Syntax-layer of compiler split into separate crate
Clang (from LLVM project) integrated into build
Typechecker split into sub-modules
New time functions
Extension methods for many built-in types
Arc: atomic-refcount read-only / exclusive-use shared cells
Par: parallel map and search routines
Extensive work on libuv interface
Much vector code moved to libraries
Syntax extensions: #line, #col, #file, #mod, #stringify, #include, #include_str, #include_bin
Cargo automatically resolves dependencies
~2000 changes, numerous bugfixes
All keywords are now strict and may not be used as identifiers anywhere
Keyword removal: 'again', 'import', 'check', 'new', 'owned', 'send', 'of', 'with', 'to', 'class'.
Classes are replaced with simpler structs
Explicit method self types
ret became return and alt became match
import is now use; use is now extern mod`
extern mod { ... } is now extern { ... }
use mod is the recommended way to import modules
pub and priv replace deprecated export lists
The syntax of match pattern arms now uses fat arrow (=>)
main no longer accepts an args vector; use os::args instead
Trait implementations are now coherent, ala Haskell typeclasses
Trait methods may be static
Argument modes are deprecated
Borrowed pointers are much more mature and recommended for use
Strings and vectors in the static region are stored in constant memory
Typestate was removed
Resolution rewritten to be more reliable
Support for 'dual-mode' data structures (freezing and thawing)
Most binary operators can now be overloaded via the traits in `core::ops'
std::net::url for representing URLs
Sendable hash maps in core::send_map
`core::task' gained a (currently unsafe) task-local storage API
An efficient new intertask communication primitive called the pipe, along with a number of higher-level channel types, in core::pipes
std::arc, an atomically reference counted, immutable, shared memory type
std::sync, various exotic synchronization tools based on arcs and pipes
Futures are now based on pipes and sendable
More robust linked task failure
Improved task builder API
Improved error reporting
Preliminary JIT support
Preliminary work on precise GC
Extensive architectural improvements to rustc
Begun a transition away from buggy C++-based reflection (shape) code to Rust-based (visitor) code
All hash functions and tables converted to secure, randomized SipHash
~900 changes, numerous bugfixes
Removed <- move operator
Completed the transition from the #fmt extension syntax to fmt!
Removed old fixed length vector syntax - [T]/N
New token-based quasi-quoters, quote_tokens!, quote_expr!, etc.
Macros may now expand to items and statements
a.b() is always parsed as a method call, never as a field projection
Eq and IterBytes implementations can be automatically generated with #[deriving_eq] and #[deriving_iter_bytes] respectively
Removed the special crate language for .rc files
Function arguments may consist of any irrefutable pattern
& and ~ pointers may point to objects
Tuple structs - struct Foo(Bar, Baz). Will replace newtype enums.
Enum variants may be structs
Destructors can be added to all nominal types with the Drop trait
Structs and nullary enum variants may be constants
Values that cannot be implicitly copied are now automatically moved without writing move explicitly
&T may now be coerced to *T
Coercions happen in let statements as well as function calls
use statements now take crate-relative paths
The module and type namespaces have been merged so that static method names can be resolved under the trait in which they are declared
Trait inheritance works in many scenarios
More support for explicit self arguments in methods - self, &self @self, and ~self all generally work as expected
Static methods work in more situations
Experimental: Traits may declare default methods for the implementations to use
New condition handling system in core::condition
Timsort added to std::sort
New priority queue, std::priority_queue
Pipes for serializable types, `std::flatpipes'
Serialization overhauled to be trait-based
Expanded getopts definitions
Moved futures to std
More functions are pure now
core::comm renamed to oldcomm. Still deprecated
rustdoc and cargo are libraries now
Added a preliminary REPL, rusti
License changed from MIT to dual MIT/APL2
~2100 changes, numerous bugfixes
The self type parameter in traits is now spelled Self
The self parameter in trait and impl methods must now be explicitly named (for example: fn f(&self) { }). Implicit self is deprecated.
Static methods no longer require the static keyword and instead are distinguished by the lack of a self parameter
Replaced the Durable trait with the 'static lifetime
The old closure type syntax with the trailing sigil has been removed in favor of the more consistent leading sigil
super is a keyword, and may be prefixed to paths
Trait bounds are separated with + instead of whitespace
Traits are implemented with impl Trait for Type instead of impl Type: Trait
Lifetime syntax is now &'l foo instead of &l/foo
The export keyword has finally been removed
The move keyword has been removed (see "Semantic changes")
The interior mutability qualifier on vectors, [mut T], has been removed. Use &mut [T], etc.
mut is no longer valid in ~mut T. Use inherited mutability
fail is no longer a keyword. Use fail!()
assert is no longer a keyword. Use assert!()
log is no longer a keyword. use debug!, etc.
1-tuples may be represented as (T,)
Struct fields may no longer be mut. Use inherited mutability, @mut T, core::mut or core::cell
extern mod { ... } is no longer valid syntax for foreign function modules. Use extern blocks: extern { ... }
Newtype enums removed. Use tuple-structs.
Trait implementations no longer support visibility modifiers
Pattern matching over vectors improved and expanded
const renamed to static to correspond to lifetime name, and make room for future static mut unsafe mutable globals.
Replaced #[deriving_eq] with #[deriving(Eq)], etc.
Clone implementations can be automatically generated with #[deriving(Clone)]
Casts to traits must use a pointer sigil, e.g. @foo as @Bar instead of foo as Bar.
Fixed length vector types are now written as [int, .. 3] instead of [int * 3].
Fixed length vector types can express the length as a constant expression. (ex: [int, .. GL_BUFFER_SIZE - 2])
Types with owned pointers or custom destructors move by default, eliminating the move keyword
All foreign functions are considered unsafe
&mut is now unaliasable
Writes to borrowed @mut pointers are prevented dynamically
() has size 0
The name of the main function can be customized using #[main]
The default type of an inferred closure is &fn instead of @fn
use statements may no longer be "chained" - they cannot import identifiers imported by previous use statements
use statements are crate relative, importing from the "top" of the crate by default. Paths may be prefixed with super:: or self:: to change the search behavior.
Method visibility is inherited from the implementation declaration
Structural records have been removed
Many more types can be used in static items, including enums 'static-lifetime pointers and vectors
Pattern matching over vectors improved and expanded
Typechecking of closure types has been overhauled to improve inference and eliminate unsoundness
Macros leave scope at the end of modules, unless that module is tagged with #[macro_escape]
Added big integers to std::bigint
Removed core::oldcomm module
Added pipe-based core::comm module
Numeric traits have been reorganized under core::num
vec::slice finally returns a slice
debug! and friends don't require a format string, e.g. debug!(Foo)
Containers reorganized around traits in core::container
core::dvec removed, ~[T] is a drop-in replacement
core::send_map renamed to core::hashmap
std::map removed; replaced with core::hashmap
std::treemap reimplemented as an owned balanced tree
std::deque and std::smallintmap reimplemented as owned containers
core::trie added as a fast ordered map for integer keys
Set types added to core::hashmap, core::trie and std::treemap
Ord split into Ord and TotalOrd. Ord is still used to overload the comparison operators, whereas TotalOrd is used by certain container types
Replaced the 'cargo' package manager with 'rustpkg'
Added all-purpose 'rust' tool
rustc --test now supports benchmarks with the #[bench] attribute
rustc now attempts to offer spelling suggestions
Improved support for ARM and Android
Preliminary MIPS backend
Improved foreign function ABI implementation for x86, x86_64
Various memory usage improvements
Rust code may be embedded in foreign code under limited circumstances
Inline assembler supported by new asm!() syntax extension.
~2000 changes, numerous bugfixes
impls no longer accept a visibility qualifier. Put them on methods instead.
The borrow checker has been rewritten with flow-sensitivity, fixing many bugs and inconveniences.
The self parameter no longer implicitly means &'self self, and can be explicitly marked with a lifetime.
Overloadable compound operators (+=, etc.) have been temporarily removed due to bugs.
The for loop protocol now requires for-iterators to return bool so they compose better.
The Durable trait is replaced with the 'static bounds.
Trait default methods work more often.
Structs with the #[packed] attribute have byte alignment and no padding between fields.
Type parameters bound by Copy must now be copied explicitly with the copy keyword.
It is now illegal to move out of a dereferenced unsafe pointer.
Option<~T> is now represented as a nullable pointer.
@mut does dynamic borrow checks correctly.
The main function is only detected at the topmost level of the crate. The #[main] attribute is still valid anywhere.
Struct fields may no longer be mutable. Use inherited mutability.
The #[no_send] attribute makes a type that would otherwise be Send, not.
The #[no_freeze] attribute makes a type that would otherwise be Freeze, not.
Unbounded recursion will abort the process after reaching the limit specified by the RUST_MAX_STACK environment variable (default: 1GB).
The vecs_implicitly_copyable lint mode has been removed. Vectors are never implicitly copyable.
#[static_assert] makes compile-time assertions about static bools.
At long last, 'argument modes' no longer exist.
The rarely used use mod statement no longer exists.
fail! and assert! accept ~str, &'static str or fmt!-style argument list.
Encodable, Decodable, Ord, TotalOrd, TotalEq, DeepClone, Rand, Zero and ToStr can all be automatically derived with #[deriving(...)].
The bytes! macro returns a vector of bytes for string, u8, char, and unsuffixed integer literals.
The core crate was renamed to std.
The std crate was renamed to extra.
More and improved documentation.
std: iterator module for external iterator objects.
Many old-style (internal, higher-order function) iterators replaced by implementations of Iterator.
std: Many old internal vector and string iterators, incl. any, all. removed.
std: The finalize method of Drop renamed to drop.
std: The drop method now takes &mut self instead of &self.
std: The prelude no longer re-exports any modules, only types and traits.
std: Prelude additions: print, println, FromStr, ApproxEq, Equiv, Iterator, IteratorUtil, many numeric traits, many tuple traits.
std: New numeric traits: Fractional, Real, RealExt, Integer, Ratio, Algebraic, Trigonometric, Exponential, Primitive.
std: Tuple traits and accessors defined for up to 12-tuples, e.g. (0, 1, 2).n2() or (0, 1, 2).n2_ref().
std: Many types implement Clone.
std: path type renamed to Path.
std: mut module and Mut type removed.
std: Many standalone functions removed in favor of methods and iterators in vec, str. In the future methods will also work as functions.
std: reinterpret_cast removed. Use transmute.
std: ascii string handling in std::ascii.
std: Rand is implemented for ~/@.
std: run module for spawning processes overhauled.
std: Various atomic types added to unstable::atomic.
std: Various types implement Zero.
std: LinearMap and LinearSet renamed to HashMap and HashSet.
std: Borrowed pointer functions moved from ptr to borrow.
std: Added os::mkdir_recursive.
std: Added os::glob function performs filesystems globs.
std: FuzzyEq renamed to ApproxEq.
std: Map now defines pop and swap methods.
std: Cell constructors converted to static methods.
extra: rc module adds the reference counted pointers, Rc and RcMut.
extra: flate module moved from std to extra.
extra: fileinput module for iterating over a series of files.
extra: Complex number type and complex module.
extra: Rational number type and rational module.
extra: BigInt, BigUint implement numeric and comparison traits.
extra: term uses terminfo now, is more correct.
extra: arc functions converted to methods.
extra: Implementation of fixed output size variations of SHA-2.
unused_variables lint mode for unused variables (default: warn).
unused_unsafe lint mode for detecting unnecessary unsafe blocks (default: warn).
unused_mut lint mode for identifying unused mut qualifiers (default: warn).
dead_assignment lint mode for unread variables (default: warn).
unnecessary_allocation lint mode detects some heap allocations that are immediately borrowed so could be written without allocating (default: warn).
missing_doc lint mode (default: allow).
unreachable_code lint mode (default: warn).
The rusti command has been rewritten and a number of bugs addressed.
rustc outputs in color on more terminals.
rustc accepts a --link-args flag to pass arguments to the linker.
rustc accepts a -Z print-link-args flag for debugging linkage.
Compiling with -g will make the binary record information about dynamic borrowcheck failures for debugging.
rustdoc has a nicer stylesheet.
Various improvements to rustdoc.
Improvements to rustpkg (see the detailed release notes).
~2200 changes, numerous bugfixes
The for loop syntax has changed to work with the Iterator trait.
At long last, unwinding works on Windows.
Default methods are ready for use.
Many trait inheritance bugs fixed.
Owned and borrowed trait objects work more reliably.
copy is no longer a keyword. It has been replaced by the Clone trait.
rustc can omit emission of code for the debug! macro if it is passed --cfg ndebug
mod.rs is now "blessed". When loading mod foo;, rustc will now look for foo.rs, then foo/mod.rs, and will generate an error when both are present.
Strings no longer contain trailing nulls. The new std::c_str module provides new mechanisms for converting to C strings.
The type of foreign functions is now extern "C" fn instead of *u8.
The FFI has been overhauled such that foreign functions are called directly, instead of through a stack-switching wrapper.
Calling a foreign function must be done through a Rust function with the #[fixed_stack_segment] attribute.
The externfn! macro can be used to declare both a foreign function and a #[fixed_stack_segment] wrapper at once.
pub and priv modifiers on extern blocks are no longer parsed.
unsafe is no longer allowed on extern fns - they are all unsafe.
priv is disallowed everywhere except for struct fields and enum variants.
&T (besides &'static T) is no longer allowed in @T.
ref bindings in irrefutable patterns work correctly now.
char is now prevented from containing invalid code points.
Casting to bool is no longer allowed.
\0 is now accepted as an escape in chars and strings.
yield is a reserved keyword.
typeof is a reserved keyword.
Crates may be imported by URL with extern mod foo = "url";.
Explicit enum discriminants may be given as uints as in enum E { V = 0u }
Static vectors can be initialized with repeating elements, e.g. static foo: [u8, .. 100]: [0, .. 100];.
Static structs can be initialized with functional record update, e.g. static foo: Foo = Foo { a: 5, .. bar };.
cfg! can be used to conditionally execute code based on the crate configuration, similarly to #[cfg(...)].
The unnecessary_qualification lint detects unneeded module prefixes (default: allow).
Arithmetic operations have been implemented on the SIMD types in std::unstable::simd.
Exchange allocation headers were removed, reducing memory usage.
format! implements a completely new, extensible, and higher-performance string formatting system. It will replace fmt!.
print! and println! write formatted strings (using the format! extension) to stdout.
write! and writeln! write formatted strings (using the format! extension) to the new Writers in std::rt::io.
The library section in which a function or static is placed may be specified with #[link_section = "..."].
The proto! syntax extension for defining bounded message protocols was removed.
macro_rules! is hygienic for let declarations.
The #[export_name] attribute specifies the name of a symbol.
unreachable! can be used to indicate unreachable code, and fails if executed.
std: Transitioned to the new runtime, written in Rust.
std: Added an experimental I/O library, rt::io, based on the new runtime.
std: A new generic range function was added to the prelude, replacing uint::range and friends.
std: range_rev no longer exists. Since range is an iterator it can be reversed with range(lo, hi).invert().
std: The chain method on option renamed to and_then; unwrap_or_default renamed to unwrap_or.
std: The iterator module was renamed to iter.
std: Integral types now support the checked_add, checked_sub, and checked_mul operations for detecting overflow.
std: Many methods in str, vec, option, result were renamed for consistency.
std: Methods are standardizing on conventions for casting methods: to_foo for copying, into_foo for moving, as_foo for temporary and cheap casts.
std: The CString type in c_str provides new ways to convert to and from C strings.
std: DoubleEndedIterator can yield elements in two directions.
std: The mut_split method on vectors partitions an &mut [T] into two splices.
std: str::from_bytes renamed to str::from_utf8.
std: pop_opt and shift_opt methods added to vectors.
std: The task-local data interface no longer uses @, and keys are no longer function pointers.
std: The swap_unwrap method of Option renamed to take_unwrap.
std: Added SharedPort to comm.
std: Eq has a default method for ne; only eq is required in implementations.
std: Ord has default methods for le, gt and ge; only lt is required in implementations.
std: is_utf8 performance is improved, impacting many string functions.
std: os::MemoryMap provides cross-platform mmap.
std: ptr::offset is now unsafe, but also more optimized. Offsets that are not 'in-bounds' are considered undefined.
std: Many freestanding functions in vec removed in favor of methods.
std: Many freestanding functions on scalar types removed in favor of methods.
std: Many options to task builders were removed since they don't make sense in the new scheduler design.
std: More containers implement FromIterator so can be created by the collect method.
std: More complete atomic types in unstable::atomics.
std: comm::PortSet removed.
std: Mutating methods in the Set and Map traits have been moved into the MutableSet and MutableMap traits. Container::is_empty, Map::contains_key, MutableMap::insert, and MutableMap::remove have default implementations.
std: Various from_str functions were removed in favor of a generic from_str which is available in the prelude.
std: util::unreachable removed in favor of the unreachable! macro.
extra: dlist, the doubly-linked list was modernized.
extra: Added a hex module with ToHex and FromHex traits.
extra: Added glob module, replacing std::os::glob.
extra: rope was removed.
extra: deque was renamed to ringbuf. RingBuf implements Deque.
extra: net, and timer were removed. The experimental replacements are std::rt::io::net and std::rt::io::timer.
extra: Iterators implemented for SmallIntMap.
extra: Iterators implemented for Bitv and BitvSet.
extra: SmallIntSet removed. Use BitvSet.
extra: Performance of JSON parsing greatly improved.
extra: semver updated to SemVer 2.0.0.
extra: term handles more terminals correctly.
extra: dbg module removed.
extra: par module removed.
extra: future was cleaned up, with some method renames.
extra: Most free functions in getopts were converted to methods.
rustc's debug info generation (-Z debug-info) is greatly improved.
rustc accepts --target-cpu to compile to a specific CPU architecture, similarly to gcc's --march flag.
rustc's performance compiling small crates is much better.
rustpkg has received many improvements.
rustpkg supports git tags as package IDs.
rustpkg builds into target-specific directories so it can be used for cross-compiling.
The number of concurrent test tasks is controlled by the environment variable RUST_TEST_TASKS.
The test harness can now report metrics for benchmarks.
All tools have man pages.
Programs compiled with --test now support the -h and --help flags.
The runtime uses jemalloc for allocations.
Segmented stacks are temporarily disabled as part of the transition to the new runtime. Stack overflows are possible!
A new documentation backend, rustdoc_ng, is available for use. It is still invoked through the normal rustdoc command.
~1800 changes, numerous bugfixes
The float type has been removed. Use f32 or f64 instead.
A new facility for enabling experimental features (feature gating) has been added, using the crate-level #[feature(foo)] attribute.
Managed boxes (@) are now behind a feature gate (#[feature(managed_boxes)]) in preparation for future removal. Use the standard library's Gc or Rc types instead.
@mut has been removed. Use std::cell::{Cell, RefCell} instead.
Jumping back to the top of a loop is now done with continue instead of loop.
Strings can no longer be mutated through index assignment.
Raw strings can be created via the basic r"foo" syntax or with matched hash delimiters, as in r###"foo"###.
~fn is now written proc (args) -> retval { ... } and may only be called once.
The &fn type is now written |args| -> ret to match the literal form.
@fns have been removed.
do only works with procs in order to make it obvious what the cost of do is.
Single-element tuple-like structs can no longer be dereferenced to obtain the inner value. A more comprehensive solution for overloading the dereference operator will be provided in the future.
The #[link(...)] attribute has been replaced with #[crate_id = "name#vers"].
Empty impls must be terminated with empty braces and may not be terminated with a semicolon.
Keywords are no longer allowed as lifetime names; the self lifetime no longer has any special meaning.
The old fmt! string formatting macro has been removed.
printf! and printfln! (old-style formatting) removed in favor of print! and println!.
mut works in patterns now, as in let (mut x, y) = (1, 2);.
The extern mod foo (name = "bar") syntax has been removed. Use extern mod foo = "bar" instead.
New reserved keywords: alignof, offsetof, sizeof.
Macros can have attributes.
Macros can expand to items with attributes.
Macros can expand to multiple items.
The asm! macro is feature-gated (#[feature(asm)]).
Comments may be nested.
Values automatically coerce to trait objects they implement, without an explicit as.
Enum discriminants are no longer an entire word but as small as needed to contain all the variants. The repr attribute can be used to override the discriminant size, as in #[repr(int)] for integer-sized, and #[repr(C)] to match C enums.
Non-string literals are not allowed in attributes (they never worked).
The FFI now supports variadic functions.
Octal numeric literals, as in 0o7777.
The concat! syntax extension performs compile-time string concatenation.
The #[fixed_stack_segment] and #[rust_stack] attributes have been removed as Rust no longer uses segmented stacks.
Non-ascii identifiers are feature-gated (#[feature(non_ascii_idents)]).
Ignoring all fields of an enum variant or tuple-struct is done with .., not *; ignoring remaining fields of a struct is also done with .., not _; ignoring a slice of a vector is done with .., not .._.
rustc supports the "win64" calling convention via extern "win64".
rustc supports the "system" calling convention, which defaults to the preferred convention for the target platform, "stdcall" on 32-bit Windows, "C" elsewhere.
The type_overflow lint (default: warn) checks literals for overflow.
The unsafe_block lint (default: allow) checks for usage of unsafe.
The attribute_usage lint (default: warn) warns about unknown attributes.
The unknown_features lint (default: warn) warns about unknown feature gates.
The dead_code lint (default: warn) checks for dead code.
Rust libraries can be linked statically to one another
#[link_args] is behind the link_args feature gate.
Native libraries are now linked with #[link(name = "foo")]
Native libraries can be statically linked to a rust crate (#[link(name = "foo", kind = "static")]).
Native OS X frameworks are now officially supported (#[link(name = "foo", kind = "framework")]).
The #[thread_local] attribute creates thread-local (not task-local) variables. Currently behind the thread_local feature gate.
The return keyword may be used in closures.
Types that can be copied via a memcpy implement the Pod kind.
The cfg attribute can now be used on struct fields and enum variants.
std: The option and result API's have been overhauled to make them simpler, more consistent, and more composable.
std: The entire std::io module has been replaced with one that is more comprehensive and that properly interfaces with the underlying scheduler. File, TCP, UDP, Unix sockets, pipes, and timers are all implemented.
std: io::util contains a number of useful implementations of Reader and Writer, including NullReader, NullWriter, ZeroReader, TeeReader.
std: The reference counted pointer type extra::rc moved into std.
std: The Gc type in the gc module will replace @ (it is currently just a wrapper around it).
std: The Either type has been removed.
std: fmt::Default can be implemented for any type to provide default formatting to the format! macro, as in format!("{}", myfoo).
std: The rand API continues to be tweaked.
std: The rust_begin_unwind function, useful for inserting breakpoints on failure in gdb, is now named rust_fail.
std: The each_key and each_value methods on HashMap have been replaced by the keys and values iterators.
std: Functions dealing with type size and alignment have moved from the sys module to the mem module.
std: The path module was written and API changed.
std: str::from_utf8 has been changed to cast instead of allocate.
std: starts_with and ends_with methods added to vectors via the ImmutableEqVector trait, which is in the prelude.
std: Vectors can be indexed with the get_opt method, which returns None if the index is out of bounds.
std: Task failure no longer propagates between tasks, as the model was complex, expensive, and incompatible with thread-based tasks.
std: The Any type can be used for dynamic typing.
std: ~Any can be passed to the fail! macro and retrieved via task::try.
std: Methods that produce iterators generally do not have an _iter suffix now.
std: cell::Cell and cell::RefCell can be used to introduce mutability roots (mutable fields, etc.). Use instead of e.g. @mut.
std: util::ignore renamed to prelude::drop.
std: Slices have sort and sort_by methods via the MutableVector trait.
std: vec::raw has seen a lot of cleanup and API changes.
std: The standard library no longer includes any C++ code, and very minimal C, eliminating the dependency on libstdc++.
std: Runtime scheduling and I/O functionality has been factored out into extensible interfaces and is now implemented by two different crates: libnative, for native threading and I/O; and libgreen, for green threading and I/O. This paves the way for using the standard library in more limited embedded environments.
std: The comm module has been rewritten to be much faster, have a simpler, more consistent API, and to work for both native and green threading.
std: All libuv dependencies have been moved into the rustuv crate.
native: New implementations of runtime scheduling on top of OS threads.
native: New native implementations of TCP, UDP, file I/O, process spawning, and other I/O.
green: The green thread scheduler and message passing types are almost entirely lock-free.
extra: The flatpipes module had bitrotted and was removed.
extra: All crypto functions have been removed and Rust now has a policy of not reimplementing crypto in the standard library. In the future crypto will be provided by external crates with bindings to established libraries.
extra: c_vec has been modernized.
extra: The sort module has been removed. Use the sort method on mutable slices.
The rust and rusti commands have been removed, due to lack of maintenance.
rustdoc was completely rewritten.
rustdoc can test code examples in documentation.
rustpkg can test packages with the argument, 'test'.
rustpkg supports arbitrary dependencies, including C libraries.
rustc's support for generating debug info is improved again.
rustc has better error reporting for unbalanced delimiters.
rustc's JIT support was removed due to bitrot.
Executables and static libraries can be built with LTO (-Z lto)
rustc adds a --dep-info flag for communicating dependencies to build tools.
~1500 changes, numerous bugfixes
A new RFC process is now in place for modifying the language.
Patterns with @-pointers have been removed from the language.
Patterns with unique vectors (~[T]) have been removed from the language.
Patterns with unique strings (~str) have been removed from the language.
@str has been removed from the language.
@[T] has been removed from the language.
@self has been removed from the language.
@Trait has been removed from the language.
Headers on ~ allocations which contain @ boxes inside the type for reference counting have been removed.
The semantics around the lifetimes of temporary expressions have changed, see #3511 and #11585 for more information.
Cross-crate syntax extensions are now possible, but feature gated. See #11151 for more information. This includes both macro_rules! macros as well as syntax extensions such as format!.
New lint modes have been added, and older ones have been turned on to be warn-by-default.
Unnecessary parentheses
Uppercase statics
Camel Case types
Uppercase variables
Publicly visible private types
#[deriving] with raw pointers
Unsafe functions can no longer be coerced to closures.
Various obscure macros such as log_syntax! are now behind feature gates.
The #[simd] attribute is now behind a feature gate.
Visibility is no longer allowed on extern crate statements, and unnecessary visibility (priv) is no longer allowed on use statements.
Trailing commas are now allowed in argument lists and tuple patterns.
The do keyword has been removed, it is now a reserved keyword.
Default type parameters have been implemented, but are feature gated.
Borrowed variables through captures in closures are now considered soundly.
extern mod is now extern crate
The Freeze trait has been removed.
The Share trait has been added for types that can be shared among threads.
Labels in macros are now hygienic.
Expression/statement macro invocations can be delimited with {} now.
Treatment of types allowed in static mut locations has been tweaked.
The * and . operators are now overloadable through the Deref and DerefMut traits.
~Trait and proc no longer have Send bounds by default.
Partial type hints are now supported with the _ type marker.
An Unsafe type was introduced for interior mutability. It is now considered undefined to transmute from &T to &mut T without using the Unsafe type.
The #[linkage] attribute was implemented for extern statics/functions.
The inner attribute syntax has changed from #[foo]; to #![foo].
Pod was renamed to Copy.
The libextra library has been removed. It has now been decomposed into component libraries with smaller and more focused nuggets of functionality. The full list of libraries can be found on the documentation index page.
std: std::condition has been removed. All I/O errors are now propagated through the Result type. In order to assist with error handling, a try! macro for unwrapping errors with an early return and a lint for unused results has been added. See #12039 for more information.
std: The vec module has been renamed to slice.
std: A new vector type, Vec
std: std::io now has more public re-exports. Types such as BufferedReader are now found at std::io::BufferedReader instead of std::io::buffered::BufferedReader.
std: print and println are no longer in the prelude, the print! and println! macros are intended to be used instead.
std: Rc now has a Weak pointer for breaking cycles, and it no longer attempts to statically prevent cycles.
std: The standard distribution is adopting the policy of pushing failure
to the user rather than failing in libraries. Many functions (such as
slice::last()) now return Option
std: fmt::Default has been renamed to fmt::Show, and it now has a new deriving mode: #[deriving(Show)].
std: ToStr is now implemented for all types implementing Show.
std: The formatting trait methods now take &self instead of &T
std: The invert() method on iterators has been renamed to rev()
std: std::num has seen a reduction in the genericity of its traits, consolidating functionality into a few core traits.
std: Backtraces are now printed on task failure if the environment variable RUST_BACKTRACE is present.
std: Naming conventions for iterators have been standardized. More details can be found on the wiki's style guide.
std: eof() has been removed from the Reader trait. Specific types may still implement the function.
std: Networking types are now cloneable to allow simultaneous reads/writes.
std: assert_approx_eq! has been removed
std: The e and E formatting specifiers for floats have been added to print them in exponential notation.
std: The Times trait has been removed
std: Indications of variance and opting out of builtin bounds is done through marker types in std::kinds::marker now
std: hash has been rewritten, IterBytes has been removed, and #[deriving(Hash)] is now possible.
std: SharedChan has been removed, Sender is now cloneable.
std: Chan and Port were renamed to Sender and Receiver.
std: Chan::new is now channel().
std: A new synchronous channel type has been implemented.
std: A select! macro is now provided for selecting over Receivers.
std: hashmap and trie have been moved to libcollections
std: run has been rolled into io::process
std: assert_eq! now uses {} instead of {:?}
std: The equality and comparison traits have seen some reorganization.
std: rand has moved to librand.
std: to_{lower,upper}case has been implemented for char.
std: Logging has been moved to liblog.
collections: HashMap has been rewritten for higher performance and less memory usage.
native: The default runtime is now libnative. If libgreen is desired, it can be booted manually. The runtime guide has more information and examples.
native: All I/O functionality except signals has been implemented.
green: Task spawning with libgreen has been optimized with stack caching and various trimming of code.
green: Tasks spawned by libgreen now have an unmapped guard page.
sync: The extra::sync module has been updated to modern rust (and moved to the sync library), tweaking and improving various interfaces while dropping redundant functionality.
sync: A new Barrier type has been added to the sync library.
sync: An efficient mutex for native and green tasks has been implemented.
serialize: The base64 module has seen some improvement. It treats newlines better, has non-string error values, and has seen general cleanup.
fourcc: A fourcc! macro was introduced
hexfloat: A hexfloat! macro was implemented for specifying floats via a hexadecimal literal.
rustpkg has been deprecated and removed from the main repository. Its replacement, cargo, is under development.
Nightly builds of rust are now available
The memory usage of rustc has been improved many times throughout this release cycle.
The build process supports disabling rpath support for the rustc binary itself.
Code generation has improved in some cases, giving more information to the LLVM optimization passes to enable more extensive optimizations.
Debuginfo compatibility with lldb on OSX has been restored.
The master branch is now gated on an android bot, making building for android much more reliable.
Output flags have been centralized into one --emit flag.
Crate type flags have been centralized into one --crate-type flag.
Codegen flags have been consolidated behind a -C flag.
Linking against outdated crates now has improved error messages.
Error messages with lifetimes will often suggest how to annotate the function to fix the error.
Many more types are documented in the standard library, and new guides were written.
Many rustdoc improvements:
code blocks are syntax highlighted.
render standalone markdown files.
the --test flag tests all code blocks by default.
exported macros are displayed.
re-exported types have their documentation inlined at the location of the first re-export.
search works across crates that have been rendered to the same output directory.
~1700 changes, numerous bugfixes
~[T] has been removed from the language. This type is superseded by
the Vec
~str has been removed from the language. This type is superseded by the String type.
~T has been removed from the language. This type is superseded by the
Box
@T has been removed from the language. This type is superseded by the
standard library's std::gc::Gc
Struct fields are now all private by default.
Vector indices and shift amounts are both required to be a uint instead of any integral type.
Byte character, byte string, and raw byte string literals are now all supported by prefixing the normal literal with a b.
Multiple ABIs are no longer allowed in an ABI string
The syntax for lifetimes on closures/procedures has been tweaked slightly: <'a>|A, B|: 'b + K -> T
Floating point modulus has been removed from the language; however it is still provided by a library implementation.
Private enum variants are now disallowed.
The priv keyword has been removed from the language.
A closure can no longer be invoked through a &-pointer.
The use foo, bar, baz; syntax has been removed from the language.
The transmute intrinsic no longer works on type parameters.
Statics now allow blocks/items in their definition.
Trait bounds are separated from objects with + instead of : now.
Objects can no longer be read while they are mutably borrowed.
The address of a static is now marked as insignificant unless the #[inline(never)] attribute is placed it.
The #[unsafe_destructor] attribute is now behind a feature gate.
Struct literals are no longer allowed in ambiguous positions such as if, while, match, and for..in.
Declaration of lang items and intrinsics are now feature-gated by default.
Integral literals no longer default to int, and floating point literals no longer default to f64. Literals must be suffixed with an appropriate type if inference cannot determine the type of the literal.
The Box
Procedures are now required to not capture borrowed references.
The standard library is now a "facade" over a number of underlying libraries. This means that development on the standard library should be speedier due to smaller crates, as well as a clearer line between all dependencies.
A new library, libcore, lives under the standard library's facade which is Rust's "0-assumption" library, suitable for embedded and kernel development for example.
A regex crate has been added to the standard distribution. This crate includes statically compiled regular expressions.
The unwrap/unwrap_err methods on Result require a Show bound for better error messages.
The return types of the std::comm primitives have been centralized around the Result type.
A number of I/O primitives have gained the ability to time out their operations.
A number of I/O primitives have gained the ability to close their reading/writing halves to cancel pending operations.
Reverse iterator methods have been removed in favor of rev() on their forward-iteration counterparts.
A bitflags! macro has been added to enable easy interop with C and management of bit flags.
A debug_assert! macro is now provided which is disabled when --cfg ndebug is passed to the compiler.
A graphviz crate has been added for creating .dot files.
The std::cast module has been migrated into std::mem.
The std::local_data api has been migrated from freestanding functions to being based on methods.
The Pod trait has been renamed to Copy.
jemalloc has been added as the default allocator for types.
The API for allocating memory has been changed to use proper alignment and sized deallocation
Connecting a TcpStream or binding a TcpListener is now based on a string address and a u16 port. This allows connecting to a hostname as opposed to an IP.
The Reader trait now contains a core method, read_at_least(), which correctly handles many repeated 0-length reads.
The process-spawning API is now centered around a builder-style Command struct.
The :? printing qualifier has been moved from the standard library to an external libdebug crate.
Eq/Ord have been renamed to PartialEq/PartialOrd. TotalEq/TotalOrd have been renamed to Eq/Ord.
The select/plural methods have been removed from format!. The escapes for { and } have also changed from { and } to {{ and }}, respectively.
The TaskBuilder API has been re-worked to be a true builder, and extension traits for spawning native/green tasks have been added.
All breaking changes to the language or libraries now have their commit message annotated with [breaking-change] to allow for easy discovery of breaking changes.
The compiler will now try to suggest how to annotate lifetimes if a lifetime-related error occurs.
Debug info continues to be improved greatly with general bug fixes and better support for situations like link time optimization (LTO).
Usage of syntax extensions when cross-compiling has been fixed.
Functionality equivalent to GCC & Clang's -ffunction-sections, -fdata-sections and --gc-sections has been enabled by default
The compiler is now stricter about where it will load module files from when a module is declared via mod foo;.
The #[phase(syntax)] attribute has been renamed to #[phase(plugin)]. Syntax extensions are now discovered via a "plugin registrar" type which will be extended in the future to other various plugins.
Lints have been restructured to allow for dynamically loadable lints.
A number of rustdoc improvements:
The HTML output has been visually redesigned.
Markdown is now powered by hoedown instead of sundown.
Searching heuristics have been greatly improved.
The search index has been reduced in size by a great amount.
Cross-crate documentation via pub use has been greatly improved.
Primitive types are now hyperlinked and documented.
Documentation has been moved from static.rust-lang.org/doc to doc.rust-lang.org
A new sandbox, play.rust-lang.org, is available for running and sharing rust code examples on-line.
Unused attributes are now more robustly warned about.
The dead_code lint now warns about unused struct fields.
Cross-compiling to iOS is now supported.
Cross-compiling to mipsel is now supported.
Stability attributes are now inherited by default and no longer apply to intra-crate usage, only inter-crate usage.
Error message related to non-exhaustive match expressions have been greatly improved.
~1900 changes, numerous bugfixes
The introductory documentation (now called The Rust Guide) has been completely rewritten, as have a number of supplementary guides.
Rust's package manager, Cargo, continues to improve and is sometimes considered to be quite awesome.
Many API's in std have been reviewed and updated for consistency with the in-development Rust coding guidelines. The standard library documentation tracks stabilization progress.
Minor libraries have been moved out-of-tree to the rust-lang org on GitHub: uuid, semver, glob, num, hexfloat, fourcc. They can be installed with Cargo.
Lifetime elision allows lifetime annotations to be left off of function declarations in many common scenarios.
Rust now works on 64-bit Windows.
Indexing can be overloaded with the Index and IndexMut traits.
The if let construct takes a branch only if the let pattern matches, currently behind the 'if_let' feature gate.
'where clauses', a more flexible syntax for specifying trait bounds that is more aesthetic, have been added for traits and free functions. Where clauses will in the future make it possible to constrain associated types, which would be impossible with the existing syntax.
A new slicing syntax (e.g. [0..4]) has been introduced behind the 'slicing_syntax' feature gate, and can be overloaded with the Slice or SliceMut traits.
The syntax for matching of sub-slices has been changed to use a postfix .. instead of prefix (.e.g. [a, b, c..]), for consistency with other uses of .. and to future-proof potential additional uses of the syntax.
The syntax for matching inclusive ranges in patterns has changed from 0..3 to 0...4 to be consistent with the exclusive range syntax for slicing.
Matching of sub-slices in non-tail positions (e.g. [a.., b, c]) has been put behind the 'advanced_slice_patterns' feature gate and may be removed in the future.
Components of tuples and tuple structs can be extracted using the value.0 syntax, currently behind the tuple_indexing feature gate.
The #[crate_id] attribute is no longer supported; versioning is handled by the package manager.
Renaming crate imports are now written extern crate foo as bar instead of extern crate bar = foo.
Renaming use statements are now written use foo as bar instead of use bar = foo.
let and match bindings and argument names in macros are now hygienic.
The new, more efficient, closure types ('unboxed closures') have been added under a feature gate, 'unboxed_closures'. These will soon replace the existing closure types, once higher-ranked trait lifetimes are added to the language.
move has been added as a keyword, for indicating closures that capture by value.
Mutation and assignment is no longer allowed in pattern guards.
Generic structs and enums can now have trait bounds.
The Share trait is now called Sync to free up the term 'shared' to refer to 'shared reference' (the default reference type.
Dynamically-sized types have been mostly implemented, unifying the behavior of fat-pointer types with the rest of the type system.
As part of dynamically-sized types, the Sized trait has been introduced, which qualifying types implement by default, and which type parameters expect by default. To specify that a type parameter does not need to be sized, write <Sized? T>. Most types are Sized, notable exceptions being unsized arrays ([T]) and trait types.
Closures can return !, as in || -> ! or proc() -> !.
Lifetime bounds can now be applied to type parameters and object types.
The old, reference counted GC type, Gc
Library documentation has been improved for a number of modules.
Bit-vectors, collections::bitv has been modernized.
The url crate is deprecated in favor of http://github.com/servo/rust-url, which can be installed with Cargo.
Most I/O stream types can be cloned and subsequently closed from a different thread.
A std::time::Duration type has been added for use in I/O methods that rely on timers, as well as in the 'time' crate's Timespec arithmetic.
The runtime I/O abstraction layer that enabled the green thread scheduler to do non-thread-blocking I/O has been removed, along with the libuv-based implementation employed by the green thread scheduler. This will greatly simplify the future I/O work.
collections::btree has been rewritten to have a more idiomatic and efficient design.
rustdoc output now indicates the stability levels of API's.
The --crate-name flag can specify the name of the crate being compiled, like #[crate_name].
The -C metadata specifies additional metadata to hash into symbol names, and -C extra-filename specifies additional information to put into the output filename, for use by the package manager for versioning.
debug info generation has continued to improve and should be more reliable under both gdb and lldb.
rustc has experimental support for compiling in parallel using the -C codegen-units flag.
rustc no longer encodes rpath information into binaries by default.
Stack usage has been optimized with LLVM lifetime annotations.
Official Rust binaries on Linux are more compatible with older kernels and distributions, built on CentOS 5.10.
~2400 changes, numerous bugfixes
The language itself is considered feature complete for 1.0, though there will be many usability improvements and bugfixes before the final release.
Nearly 50% of the public API surface of the standard library has been declared 'stable'. Those interfaces are unlikely to change before 1.0.
The long-running debate over integer types has been settled: Rust will ship with types named isize and usize, rather than int and uint, for pointer-sized integers. Guidelines will be rolled out during the alpha cycle.
Most crates that are not std have been moved out of the Rust distribution into the Cargo ecosystem so they can evolve separately and don't need to be stabilized as quickly, including 'time', 'getopts', 'num', 'regex', and 'term'.
Documentation continues to be expanded with more API coverage, more examples, and more in-depth explanations. The guides have been consolidated into The Rust Programming Language.
"Rust By Example" is now maintained by the Rust team.
All official Rust binary installers now come with Cargo, the Rust package manager.
Closures have been completely redesigned to be implemented in terms of traits, can now be used as generic type bounds and thus monomorphized and inlined, or via an opaque pointer (boxed) as in the old system. The new system is often referred to as 'unboxed' closures.
Traits now support associated types, allowing families of related types to be defined together and used generically in powerful ways.
Enum variants are namespaced by their type names.
where clauses provide a more versatile and attractive syntax for specifying generic bounds, though the previous syntax remains valid.
Rust again picks a fallback (either i32 or f64) for uninferred numeric types.
Rust no longer has a runtime of any description, and only supports OS threads, not green threads.
At long last, Rust has been overhauled for 'dynamically-sized types' (DST), which integrates 'fat pointers' (object types, arrays, and str) more deeply into the type system, making it more consistent.
Rust now has a general range syntax, i..j, i.., and ..j that produce range types and which, when combined with the Index operator and multidispatch, leads to a convenient slice notation, [i..j].
The new range syntax revealed an ambiguity in the fixed-length array syntax, so now fixed length arrays are written [T; N].
The Copy trait is no longer implemented automatically. Unsafe pointers no longer implement Sync and Send so types containing them don't automatically either. Sync and Send are now 'unsafe traits' so one can "forcibly" implement them via unsafe impl if a type confirms to the requirements for them even though the internals do not (e.g. structs containing unsafe pointers like Arc). These changes are intended to prevent some footguns and are collectively known as opt-in built-in traits (though Sync and Send will soon become pure library types unknown to the compiler).
Operator traits now take their operands by value, and comparison traits can use multidispatch to compare one type against multiple other types, allowing e.g. String to be compared with &str.
if let and while let are no longer feature-gated.
Rust has adopted a more uniform syntax for escaping unicode characters.
macro_rules! has been declared stable. Though it is a flawed system it is sufficiently popular that it must be usable for 1.0. Effort has gone into future-proofing it in ways that will allow other macro systems to be developed in parallel, and won't otherwise impact the evolution of the language.
The prelude has been pared back significantly such that it is the minimum necessary to support the most pervasive code patterns, and through generalized where clauses many of the prelude extension traits have been consolidated.
Rust's rudimentary reflection has been removed, as it incurred too much code generation for little benefit.
Struct variants are no longer feature-gated.
Trait bounds can be polymorphic over lifetimes. Also known as 'higher-ranked trait bounds', this crucially allows unboxed closures to work.
Macros invocations surrounded by parens or square brackets and not terminated by a semicolon are parsed as expressions, which makes expressions like vec![1i32, 2, 3].len() work as expected.
Trait objects now implement their traits automatically, and traits that can be coerced to objects now must be object safe.
Automatically deriving traits is now done with #[derive(...)] not #[deriving(...)] for consistency with other naming conventions.
Importing the containing module or enum at the same time as items or variants they contain is now done with self instead of mod, as in use foo::{self, bar}
Glob imports are no longer feature-gated.
The box operator and box patterns have been feature-gated pending a redesign. For now unique boxes should be allocated like other containers, with Box::new.
A series of efforts to establish conventions for collections types has resulted in API improvements throughout the standard library.
New APIs for error handling provide ergonomic interop between error types, and new conventions describe more clearly the recommended error handling strategies in Rust.
The fail! macro has been renamed to panic! so that it is easier to discuss failure in the context of error handling without making clarifications as to whether you are referring to the 'fail' macro or failure more generally.
On Linux, OsRng prefers the new, more reliable getrandom syscall when available.
The 'serialize' crate has been renamed 'rustc-serialize' and moved out of the distribution to Cargo. Although it is widely used now, it is expected to be superseded in the near future.
The Show formatter, typically implemented with #[derive(Show)] is now requested with the {:?} specifier and is intended for use by all types, for uses such as println! debugging. The new String formatter must be implemented by hand, uses the {} specifier, and is intended for full-fidelity conversions of things that can logically be represented as strings.
Flexible target specification allows rustc's code generation to be configured to support otherwise-unsupported platforms.
Rust comes with rust-gdb and rust-lldb scripts that launch their respective debuggers with Rust-appropriate pretty-printing.
The Windows installation of Rust is distributed with the MinGW components currently required to link binaries on that platform.
Nullable enum optimizations have been extended to more types so
that e.g. Option
Work has begun on supporting AArch64.
The various I/O modules were overhauled to reduce unnecessary abstractions and provide better interoperation with the underlying platform. The old io module remains temporarily at std::old_io.
The standard library now participates in feature gating, so use of unstable libraries now requires a #![feature(...)] attribute. The impact of this change is described on the forum. RFC.
for loops now operate on the IntoIterator trait, which eliminates the need to call .iter(), etc. to iterate over collections. There are some new subtleties to remember though regarding what sort of iterators various types yield, in particular that for foo in bar { } yields values from a move iterator, destroying the original collection. RFC.
Objects now have default lifetime bounds, so you don't
have to write Box
In types that implement Drop, lifetimes must outlive the value. This will soon make it possible to safely implement Drop for types where #[unsafe_destructor] is now required. Read the gorgeous RFC for details.
The fully qualified
References to types that implement Deref<U> now automatically coerce to references to the dereferenced type U, e.g. &T where T: Deref<U> automatically coerces to &U. This should eliminate many unsightly uses of &*, as when converting from references to vectors into references to slices. RFC.
The explicit closure kind syntax (|&:|, |&mut:|, |:|) is obsolete and closure kind is inferred from context.
The Show and String formatting traits have been renamed to Debug and Display to more clearly reflect their related purposes. Automatically getting a string conversion to use with format!("{:?}", something_to_debug) is now written #[derive(Debug)].
Abstract OS-specific string types, std::ff::{OsString, OsStr}, provide strings in platform-specific encodings for easier interop with system APIs. RFC.
The boxed::into_raw and Box::from_raw functions convert
between Box
Certain long error messages of the form 'expected foo found bar' are now split neatly across multiple lines. Examples in the PR.
On Unix Rust can be uninstalled by running /usr/local/lib/rustlib/uninstall.sh.
The #[rustc_on_unimplemented] attribute, requiring the 'on_unimplemented' feature, lets rustc display custom error messages when a trait is expected to be implemented for a type but is not.
Rust is tested against a LALR grammar, which parses almost all the Rust files that rustc does.
~1500 changes, numerous bugfixes
The vast majority of the standard library is now #[stable]. It is no longer possible to use unstable features with a stable build of the compiler.
Many popular crates on crates.io now work on the stable release channel.
Arithmetic on basic integer types now checks for overflow in debug builds.
Several restrictions have been added to trait coherence in order to make it easier for upstream authors to change traits without breaking downstream code.
Digits of binary and octal literals are lexed more eagerly to improve error messages and macro behavior. For example, 0b1234 is now lexed as 0b1234 instead of two tokens, 0b1 and 234.
Trait bounds are always invariant, eliminating the need for the PhantomFn and MarkerTrait lang items, which have been removed.
"-" is no longer a valid character in crate names, the extern crate "foo" as bar syntax has been replaced with extern crate foo as bar, and Cargo now automatically translates "-" in package names to underscore for the crate name.
UFCS now supports trait-less associated paths like MyType::default().
Primitive types now have inherent methods, obviating the need for extension traits like SliceExt.
Methods with Self: Sized in their where clause are considered object-safe, allowing many extension traits like IteratorExt to be merged into the traits they extended.
You can now refer to associated types whose corresponding trait bounds appear only in a where clause.
The final bits of OIBIT landed, meaning that traits like Send and Sync are now library-defined.
A Reflect trait was introduced, which means that downcasting via the Any trait is effectively limited to concrete types. This helps retain the potentially-important "parametricity" property: generic code cannot behave differently for different type arguments except in minor ways.
The unsafe_destructor feature is now deprecated in favor of the new dropck. This change is a major reduction in unsafe code.
The thread_local module has been renamed to std::thread.
The methods of IteratorExt have been moved to the Iterator trait itself.
Several traits that implement Rust's conventions for type conversions, AsMut, AsRef, From, and Into have been centralized in the std::convert module.
The FromError trait was removed in favor of From.
The basic sleep function has moved to std::thread::sleep_ms.
The splitn function now takes an n parameter that represents the number of items yielded by the returned iterator instead of the number of 'splits'.
Methods for searching strings are generic over Patterns, implemented presently by &char, &str, FnMut(char) -> bool and some others.
In method resolution, object methods are resolved before inherent methods.
String::from_str has been deprecated in favor of the From impl, String::from.
The words method on &str has been replaced with split_whitespace, to avoid answering the tricky question, 'what is a word?'
The new path and IO modules are complete and #[stable]. This was the major library focus for this cycle.
The path API was revised to normalize ., adjusting the tradeoffs in favor of the most common usage.
A large number of remaining APIs in std were also stabilized during this cycle; about 75% of the non-deprecated API surface is now stable.
The new string pattern API landed, which makes the string slice API much more internally consistent and flexible.
A new set of generic conversion traits replaced many existing ad hoc traits.
Generic numeric traits were completely removed. This was made possible thanks to inherent methods for primitive types, and the removal gives maximal flexibility for designing a numeric hierarchy in the future.
The Fn traits are now related via inheritance and provide ergonomic blanket implementations.
The Index and IndexMut traits were changed to take the index by value, enabling code like hash_map["string"] to work.
Copy now inherits from Clone, meaning that all Copy data is known to be Clone as well.
Many errors now have extended explanations that can be accessed with the --explain flag to rustc.
Many new examples have been added to the standard library documentation.
rustdoc has received a number of improvements focused on completion and polish.
Metadata was tuned, shrinking binaries by 27%.
Much headway was made on ecosystem-wide CI, making it possible to compare builds for breakage.
~850 changes, numerous bugfixes
The std::fs module has been expanded to expand the set of functionality exposed:
DirEntry now supports optimizations like file_type and metadata which don't incur a syscall on some platforms.
A symlink_metadata function has been added.
The fs::Metadata structure now lowers to its OS counterpart, providing access to all underlying information.
The compiler now contains extended explanations of many errors. When an error with an explanation occurs the compiler suggests using the --explain flag to read the explanation. Error explanations are also available online.
Thanks to multiple improvements to type checking, as well as other work, the time to bootstrap the compiler decreased by 32%.
The str::split_whitespace method splits a string on unicode whitespace boundaries.
On both Windows and Unix, new extension traits provide conversion of I/O types to and from the underlying system handles. On Unix, these traits are FromRawFd and AsRawFd, on Windows FromRawHandle and AsRawHandle. These are implemented for File, TcpStream, TcpListener, and UpdSocket. Further implementations for std::process will be stabilized later.
On Unix, std::os::unix::symlink creates symlinks. On Windows, symlinks can be created with std::os::windows::symlink_dir and std::os::windows::symlink_file.
The mpsc::Receiver type can now be converted into an iterator with into_iter on the IntoIterator trait.
Ipv4Addr can be created from u32 with the From<u32> implementation of the From trait.
The Debug implementation for RangeFull creates output that is more consistent with other implementations.
The Default implementation for Arc no longer requires Sync + Send.
Incorrect handling of paths on Windows has been improved in both the compiler and the standard library.
In accordance with Rust's policy on arithmetic overflow abs now panics on overflow when debug assertions are enabled.
The Cloned iterator, which was accidentally left unstable for 1.0 has been stabilized.
The Incoming iterator, which iterates over incoming TCP connections, and which was accidentally unnamable in 1.0, is now properly exported.
BinaryHeap no longer corrupts itself when functions called by sift_up or sift_down panic.
The split_off method of LinkedList no longer corrupts the list in certain scenarios.
Type checking performance has improved notably with multiple improvements.
The compiler suggests code changes for more errors.
rustc and it's build system have experimental support for building toolchains against MUSL instead of glibc on Linux.
The compiler defines the target_env cfg value, which is used for distinguishing toolchains that are otherwise for the same platform. Presently this is set to gnu for common GNU Linux targets and for MinGW targets, and musl for MUSL Linux targets.
The cargo rustc command invokes a build with custom flags to rustc.
The drop_with_repr_extern lint warns about mixing repr(C) with Drop.
~1200 changes, numerous bugfixes
Dynamically-sized-type coercions allow smart pointer types like Rc to contain types without a fixed size, arrays and trait objects, finally enabling use of Rc<[T]> and completing the implementation of DST.
Parallel codegen is now working again, which can substantially speed up large builds in debug mode; It also gets another ~33% speedup when bootstrapping on a 4 core machine (using 8 jobs). It's not enabled by default, but will be "in the near future". It can be activated with the -C codegen-units=N flag to rustc.
This is the first release with experimental support for linking with the MSVC linker and lib C on Windows (instead of using the GNU variants via MinGW). It is yet recommended only for the most intrepid Rustaceans.
Benchmark compilations are showing a 30% improvement in bootstrapping over 1.1.
The to_uppercase and to_lowercase methods on char now do unicode case mapping, which is a previously-planned change in behavior and considered a bugfix.
mem::align_of now specifies the minimum alignment for T, which is usually the alignment programs are interested in, and the same value reported by clang's alignof. mem::min_align_of is deprecated. This is not known to break real code.
The #[packed] attribute is no longer silently accepted by the compiler. This attribute did nothing and code that mentioned it likely did not work as intended.
Associated type defaults are now behind the associated_type_defaults feature gate. In 1.1 associated type defaults did not work, but could be mentioned syntactically. As such this breakage has minimal impact.
Patterns with ref mut now correctly invoke DerefMut when matching against dereferenceable values.
The Extend trait, which grows a collection from an iterator, is implemented over iterators of references, for String, Vec, LinkedList, VecDeque, EnumSet, BinaryHeap, VecMap, BTreeSet and BTreeMap. RFC.
The iter::once function returns an iterator that yields a single element, and iter::empty returns an iterator that yields no elements.
The matches and rmatches methods on str return iterators over substring matches.
A number of methods for wrapping arithmetic are added to the integral types, wrapping_div, wrapping_rem, wrapping_neg, wrapping_shl, wrapping_shr. These are in addition to the existing wrapping_add, wrapping_sub, and wrapping_mul methods, and alternatives to the Wrapping type.. It is illegal for the default arithmetic operations in Rust to overflow; the desire to wrap must be explicit.
The {:#?} formatting specifier displays the alternate, pretty-printed form of the Debug formatter. This feature was actually introduced prior to 1.0 with little fanfare.
fmt::Formatter implements fmt::Write, a fmt-specific trait for writing data to formatted strings, similar to io::Write.
fmt::Formatter adds 'debug builder' methods, debug_struct, debug_tuple, debug_list, debug_set, debug_map. These are used by code generators to emit implementations of Debug.
str has new to_uppercase and to_lowercase methods that convert case, following Unicode case mapping.
It is now easier to handle poisoned locks. The PoisonError type, returned by failing lock operations, exposes into_inner, get_ref, and get_mut, which all give access to the inner lock guard, and allow the poisoned lock to continue to operate. The is_poisoned method of RwLock and Mutex can poll for a poisoned lock without attempting to take the lock.
On Unix the FromRawFd trait is implemented for Stdio, and AsRawFd for ChildStdin, ChildStdout, ChildStderr. On Windows the FromRawHandle trait is implemented for Stdio, and AsRawHandle for ChildStdin, ChildStdout, ChildStderr.
io::ErrorKind has a new variant, InvalidData, which indicates malformed input.
rustc employs smarter heuristics for guessing at typos.
rustc emits more efficient code for no-op conversions between unsafe pointers.
Fat pointers are now passed in pairs of immediate arguments, resulting in faster compile times and smaller code.
~900 changes, numerous bugfixes
The new object lifetime defaults have been turned
on after a cycle of warnings about the change. Now types
like &'a Box
The Rustonomicon is a new book in the official documentation that dives into writing unsafe Rust.
The Duration API, has been stabilized. This basic unit of timekeeping is employed by other std APIs, as well as out-of-tree time crates.
The new object lifetime defaults have been turned on after a cycle of warnings about the change.
There is a known regression in how object lifetime elision is interpreted, the proper solution for which is undetermined.
The #[prelude_import] attribute, an internal implementation detail, was accidentally stabilized previously. It has been put behind the prelude_import feature gate. This change is believed to break no existing code.
The behavior of size_of_val and align_of_val is more sane for dynamically sized types. Code that relied on the previous behavior is thought to be broken.
The dropck rules, which checks that destructors can't access destroyed values, have been updated to match the RFC. This fixes some soundness holes, and as such will cause some previously-compiling code to no longer build.
The new object lifetime defaults have been turned on after a cycle of warnings about the change.
Semicolons may now follow types and paths in macros.
The behavior of size_of_val and align_of_val is more sane for dynamically sized types. Code that relied on the previous behavior is not known to exist, and suspected to be broken.
'static variables may now be recursive.
ref bindings choose between Deref and DerefMut implementations correctly.
The dropck rules, which checks that destructors can't access destroyed values, have been updated to match the RFC.
The Duration API, has been stabilized, as well as the std::time module, which presently contains only Duration.
Box<str> and Box<[T]> both implement Clone.
The owned C string, CString, implements Borrow and the borrowed C string, CStr, implements ToOwned. The two of these allow C strings to be borrowed and cloned in generic code.
Error trait objects can be downcast to their concrete types in many common configurations, using the is, downcast, downcast_ref and downcast_mut methods, similarly to the Any trait.
Searching for substrings now employs the two-way algorithm instead of doing a naive search. This gives major speedups to a number of methods, including contains, find, rfind, split. starts_with and ends_with are also faster.
The performance of PartialEq for slices is much faster.
The Hash trait offers the default method, hash_slice, which is overridden and optimized by the implementations for scalars.
The Hasher trait now has a number of specialized write_* methods for primitive types, for efficiency.
The I/O-specific error type, std::io::Error, gained a set of methods for accessing the 'inner error', if any: get_ref, get_mut, into_inner. As well, the implementation of std::error::Error::cause also delegates to the inner error.
process::Child gained the id method, which returns a u32 representing the platform-specific process identifier.
The connect method on slices is deprecated, replaced by the new join method (note that both of these are on the unstable SliceConcatExt trait, but through the magic of the prelude are available to stable code anyway).
Performance of SipHash (the default hasher for HashMap) is better for long data.
The read_to_end implementations for Stdin and File are now specialized to use uninitialized buffers for increased performance.
Lifetime parameters of foreign functions are now resolved properly.
Rust can now, with some coercion, produce programs that run on Windows XP, though XP is not considered a supported platform.
Porting Rust on Windows from the GNU toolchain to MSVC continues (1, 2, 3, 4). It is still not recommended for use in 1.3, though should be fully-functional in the 64-bit 1.4 beta.
On Fedora-based systems installation will properly configure the dynamic linker.
The compiler gained many new extended error descriptions, which can be accessed with the --explain flag.
The dropck pass, which checks that destructors can't access destroyed values, has been rewritten. This fixes some soundness holes, and as such will cause some previously-compiling code to no longer build.
rustc now uses LLVM to write archive files where possible. Eventually this will eliminate the compiler's dependency on the ar utility.
Rust has preliminary support for i686 FreeBSD (it has long supported FreeBSD on x86_64).
The unused_mut, unconditional_recursion, improper_ctypes, and negate_unsigned lints are more strict.
If landing pads are disabled (with -Z no-landing-pads), panic! will kill the process instead of leaking.
~1200 changes, numerous bugfixes
Windows builds targeting the 64-bit MSVC ABI and linker (instead of GNU) are now supported and recommended for use.
Several changes have been made to fix type soundness and improve the behavior of associated types. See RFC 1214. Although we have mostly introduced these changes as warnings this release, to become errors next release, there are still some scenarios that will see immediate breakage.
The str::lines and BufRead::lines iterators treat \r\n as line breaks in addition to \n.
use statements that import multiple items can now rename them, as in use foo::{bar as kitten, baz as puppy}.
pub extern crate, which does not behave as expected, issues a warning until a better solution is found.
Many APIs were stabilized: <Box<str>>::into_string, Arc::downgrade, Arc::get_mut, Arc::make_mut, Arc::try_unwrap, Box::from_raw, Box::into_raw, CStr::to_str, CStr::to_string_lossy, CString::from_raw, CString::into_raw, IntoRawFd::into_raw_fd, IntoRawFd, IntoRawHandle::into_raw_handle, IntoRawHandle, IntoRawSocket::into_raw_socket, IntoRawSocket, Rc::downgrade, Rc::get_mut, Rc::make_mut, Rc::try_unwrap, Result::expect, String::into_boxed_str, TcpStream::read_timeout, TcpStream::set_read_timeout, TcpStream::set_write_timeout, TcpStream::write_timeout, UdpSocket::read_timeout, UdpSocket::set_read_timeout, UdpSocket::set_write_timeout, UdpSocket::write_timeout, Vec::append, Vec::split_off, VecDeque::append, VecDeque::retain, VecDeque::split_off, rc::Weak::upgrade, rc::Weak, slice::Iter::as_slice, slice::IterMut::into_slice, str::CharIndices::as_str, str::Chars::as_str, str::split_at_mut, str::split_at, sync::Weak::upgrade, sync::Weak, thread::park_timeout, thread::sleep.
Some APIs were deprecated: BTreeMap::with_b, BTreeSet::with_b, Option::as_mut_slice, Option::as_slice, Result::as_mut_slice, Result::as_slice, f32::from_str_radix, f64::from_str_radix.
Reverse-searching strings is faster with the 'two-way' algorithm.
The Windows, Chunks, and ChunksMut iterators over slices all override count, nth and last with an O(1) implementation.
Extend<String> and FromIterator<String are both implemented for String.
IntoIterator is implemented for references to Option and Result.
HashMap and HashSet implement Extend<&T> where T: Copy as part of RFC 839. This will cause type inference breakage in rare situations.
extern fns with the "Rust" and "C" ABIs implement common traits including Eq, Ord, Debug, Hash.
&mut T where T: std::fmt::Write also implements std::fmt::Write.
The compiler no longer uses the 'morestack' feature to prevent stack overflow. Instead it uses guard pages and stack probes (though stack probes are not yet implemented on any platform but Windows).
The compiler matches traits faster when projections are involved.
The 'improper_ctypes' lint no longer warns about use of isize and usize.
Cargo now displays useful information about what its doing during cargo update.
~700 changes, numerous bugfixes
Stabilized APIs: BinaryHeap::from, BinaryHeap::into_sorted_vec, BinaryHeap::into_vec, Condvar::wait_timeout, FileTypeExt::is_block_device, FileTypeExt::is_char_device, FileTypeExt::is_fifo, FileTypeExt::is_socket, FileTypeExt, Formatter::alternate, Formatter::fill, Formatter::precision, Formatter::sign_aware_zero_pad, Formatter::sign_minus, Formatter::sign_plus, Formatter::width, Iterator::cmp, Iterator::eq, Iterator::ge, Iterator::gt, Iterator::le, Iterator::lt, Iterator::ne, Iterator::partial_cmp, Path::canonicalize, Path::exists, Path::is_dir, Path::is_file, Path::metadata, Path::read_dir, Path::read_link, Path::symlink_metadata, Utf8Error::valid_up_to, Vec::resize, VecDeque::as_mut_slices, VecDeque::as_slices, VecDeque::insert, VecDeque::shrink_to_fit, VecDeque::swap_remove_back, VecDeque::swap_remove_front, slice::split_first_mut, slice::split_first, slice::split_last_mut, slice::split_last, char::from_u32_unchecked, fs::canonicalize, str::MatchIndices, str::RMatchIndices, str::match_indices, str::rmatch_indices, str::slice_mut_unchecked, string::ParseError.
Rust applications hosted on crates.io can be installed locally to ~/.cargo/bin with the cargo install command. Among other things this makes it easier to augment Cargo with new subcommands: when a binary named e.g. cargo-foo is found in $PATH it can be invoked as cargo foo.
Crates with wildcard (*) dependencies will emit warnings when published. In 1.6 it will no longer be possible to publish crates with wildcard dependencies.
The rules determining when a particular lifetime must outlive a particular value (known as 'dropck') have been modified to not rely on parametricity.
Implementations of AsRef and AsMut were added to Box, Rc, and Arc. Because these smart pointer types implement Deref, this causes breakage in cases where the interior type contains methods of the same name.
Correct a bug in Rc/Arc that caused dropck to be unaware that they could drop their content. Soundness fix.
All method invocations are properly checked for well-formedness. Soundness fix.
Traits whose supertraits contain Self are not object safe. Soundness fix.
Target specifications support a no_default_libraries setting that controls whether -nodefaultlibs is passed to the linker, and in turn the is_like_windows setting no longer affects the -nodefaultlibs flag.
#[derive(Show)], long-deprecated, has been removed.
The #[inline] and #[repr] attributes can only appear in valid locations.
Native libraries linked from the local crate are passed to the linker before native libraries from upstream crates.
Two rarely-used attributes, #[no_debug] and #[omit_gdb_pretty_printer_section] are feature gated.
Negation of unsigned integers, which has been a warning for several releases, is now behind a feature gate and will generate errors.
The parser accidentally accepted visibility modifiers on enum variants, a bug which has been fixed.
A bug was fixed that allowed use statements to import unstable features.
When evaluating expressions at compile-time that are not compile-time constants (const-evaluating expressions in non-const contexts), incorrect code such as overlong bitshifts and arithmetic overflow will generate a warning instead of an error, delaying the error until runtime. This will allow the const-evaluator to be expanded in the future backwards-compatibly.
The improper_ctypes lint no longer warns about using isize and usize in FFI.
Arc
Default is implemented for mutable slices.
FromStr is implemented for SockAddrV4 and SockAddrV6.
There are now From conversions between floating point types where the conversions are lossless.
There are now From conversions between integer types where the conversions are lossless.
The parse method accepts a leading "+" when parsing integers.
The clone_from implementations for String and BinaryHeap have been optimized and no longer rely on the default impl.
The extern "Rust", extern "C", unsafe extern "Rust" and unsafe extern "C" function types now implement Clone, PartialEq, Eq, PartialOrd, Ord, Hash, fmt::Pointer, and fmt::Debug for up to 12 arguments.
Dropping Vecs is much faster in unoptimized builds when the element types don't implement Drop.
A bug that caused in incorrect behavior when combining VecDeque with zero-sized types was resolved.
Improvements to deref translation increased performance in unoptimized builds.
Various errors in trait resolution are deduplicated to only be reported once.
Rust has preliminary support for rumprun kernels.
Rust has preliminary support for NetBSD on amd64.
The #![no_std] attribute causes a crate to not be linked to the standard library, but only the core library, as described in RFC 1184. The core library defines common types and traits but has no platform dependencies whatsoever, and is the basis for Rust software in environments that cannot support a full port of the standard library, such as operating systems. Most of the core library is now stable.
Stabilized APIs: Read::read_exact, ErrorKind::UnexpectedEof (renamed from UnexpectedEOF), fs::DirBuilder, fs::DirBuilder::new, fs::DirBuilder::recursive, fs::DirBuilder::create, os::unix::fs::DirBuilderExt, os::unix::fs::DirBuilderExt::mode, vec::Drain, vec::Vec::drain, string::Drain, string::String::drain, vec_deque::Drain, vec_deque::VecDeque::drain, collections::hash_map::Drain, collections::hash_map::HashMap::drain, collections::hash_set::Drain, collections::hash_set::HashSet::drain, collections::binary_heap::Drain, collections::binary_heap::BinaryHeap::drain, Vec::extend_from_slice (renamed from push_all), Mutex::get_mut, Mutex::into_inner, RwLock::get_mut, RwLock::into_inner, Iterator::min_by_key (renamed from min_by), Iterator::max_by_key (renamed from max_by).
The core library is stable, as are most of its APIs.
The assert_eq! macro supports arguments that don't implement Sized, such as arrays. In this way it behaves more like assert!.
Several timer functions that take duration in milliseconds are deprecated in favor of those that take Duration. These include Condvar::wait_timeout_ms, thread::sleep_ms, and thread::park_timeout_ms.
The algorithm by which Vec reserves additional elements was tweaked to not allocate excessive space while still growing exponentially.
From conversions are implemented from integers to floats in cases where the conversion is lossless. Thus they are not implemented for 32-bit ints to f32, nor for 64-bit ints to f32 or f64. They are also not implemented for isize and usize because the implementations would be platform-specific. From is also implemented from f32 to f64.
From<&Path> and From<PathBuf> are implemented for Cow<Path>.
From
IntoIterator is implemented for &PathBuf and &Path.
BinaryHeap was refactored for modest performance improvements.
Sorting slices that are already sorted is 50% faster in some cases.
Cargo will look in $CARGO_HOME/bin for subcommands by default.
Cargo build scripts can specify their dependencies by emitting the rerun-if-changed key.
crates.io will reject publication of crates with dependencies that have a wildcard version constraint. Crates with wildcard dependencies were seen to cause a variety of problems, as described in RFC 1241. Since 1.5 publication of such crates has emitted a warning.
cargo clean accepts a --release flag to clean the release folder. A variety of artifacts that Cargo failed to clean are now correctly deleted.
The unreachable_code lint warns when a function call's argument diverges.
The parser indicates failures that may be caused by confusingly-similar Unicode characters
Certain macro errors are reported at definition time, not expansion.
The compiler no longer makes use of the RUST_PATH environment variable when locating crates. This was a pre-cargo feature for integrating with the package manager that was accidentally never removed.
A number of bugs were fixed in the privacy checker that could cause previously-accepted code to break.
Bugs in pattern matching unit structs were fixed. The tuple struct pattern syntax (Foo(..)) can no longer be used to match unit structs. This is a warning now, but will become an error in future releases. Patterns that share the same name as a const are now an error.
A bug was fixed that causes rustc not to apply default type parameters when resolving certain method implementations of traits defined in other crates.
Stabilized APIs
Path
Path::strip_prefix (renamed from relative_from)
path::StripPrefixError (new error type returned from strip_prefix)
Ipv4Addr
Ipv6Addr
Vec
String
Slices
<[T]>::clone_from_slice, which now requires the two slices to be the same length
<[T]>::sort_by_key
checked, saturated, and overflowing operations
i32::checked_rem, i32::checked_neg, i32::checked_shl, i32::checked_shr
i32::overflowing_add, i32::overflowing_sub, i32::overflowing_mul, i32::overflowing_div
i32::overflowing_rem, i32::overflowing_neg, i32::overflowing_shl, i32::overflowing_shr
u32::checked_rem, u32::checked_neg, u32::checked_shl, u32::checked_shl
u32::overflowing_add, u32::overflowing_sub, u32::overflowing_mul, u32::overflowing_div
u32::overflowing_rem, u32::overflowing_neg, u32::overflowing_shl, u32::overflowing_shr
and checked, saturated, and overflowing operations for other primitive types
FFI
IntoStringError
Error for IntoStringError
Hashing
Validating UTF-8 is faster by a factor of between 7 and 14x for ASCII input. This means that creating Strings and strs from bytes is faster.
f32::to_degrees and f32::to_radians are stable. The f64 variants were stabilized previously.
BTreeSet and its iterators, Iter, IntoIter, and Range are covariant over their contained type.
LinkedList and its iterators, Iter and IntoIter are covariant over their contained type.
str::replace now accepts a Pattern, like other string searching methods.
When running tests with --test, rustdoc will pass --cfg arguments to the compiler.
The compiler is built with RPATH information by default. This means that it will be possible to run rustc when installed in unusual configurations without configuring the dynamic linker search path explicitly.
rustc passes --enable-new-dtags to GNU ld. This makes any RPATH entries (emitted with -C rpath) not take precedence over LD_LIBRARY_PATH.
Soundness fixes to the interactions between associated types and lifetimes, specified in RFC 1214, now generate errors for code that violates the new rules. This is a significant change that is known to break existing code, so it has emitted warnings for the new error cases since 1.4 to give crate authors time to adapt. The details of what is changing are subtle; read the RFC for more.
Several bugs in the compiler's visibility calculations were fixed. Since this was found to break significant amounts of code, the new errors will be emitted as warnings for several release cycles, under the private_in_public lint.
Defaulted type parameters were accidentally accepted in positions that were not intended. In this release, defaulted type parameters appearing outside of type definitions will generate a warning, which will become an error in future releases.
Parsing "." as a float results in an error instead of 0.
That is, ".".parse::
Rust supports overloading of compound assignment statements like += by implementing the AddAssign, SubAssign, MulAssign, DivAssign, RemAssign, BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, or ShrAssign traits. RFC 953.
Empty structs can be defined with braces, as in struct Foo { }, in addition to the non-braced form, struct Foo;. RFC 218.
Stabilized APIs:
str::encode_utf16 (renamed from utf16_units)
str::EncodeUtf16 (renamed from Utf16Units)
Instant::duration_since (renamed from duration_from_earlier)
SystemTime::duration_since (renamed from duration_from_earlier)
Various Add/Sub impls for Time and SystemTime
Various impls for SystemTimeError
AddAssign, SubAssign, MulAssign, DivAssign, RemAssign, BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign.
The write! and writeln! macros correctly emit errors if any of their arguments can't be formatted.
The Unix-specific raw modules, which contain a number of redefined C types are deprecated, including os::raw::unix, os::raw::macos, and os::raw::linux. These modules defined types such as ino_t and dev_t. The inconsistency of these definitions across platforms was making it difficult to implement std correctly. Those that need these definitions should use the libc crate. RFC 1415.
The Unix-specific MetadataExt traits, including os::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415.
Inlining hash functions lead to a 3% compile-time improvement in some workloads.
When using jemalloc, its symbols are unprefixed so that it overrides the libc malloc implementation. This means that for rustc, LLVM is now using jemalloc, which results in a 6% compile-time improvement on a specific workload.
32-bit MSVC builds finally implement unwinding. i686-pc-windows-msvc is now considered a tier-1 platform.
The --print targets flag prints a list of supported targets.
The --print cfg flag prints the cfgs defined for the current target.
rustc can be built with an new Cargo-based build system, written in Rust. It will eventually replace Rust's Makefile-based build system. To enable it configure with configure --rustbuild.
The Rust Project now publishes binary releases of the standard library for a number of tier-2 targets: armv7-unknown-linux-gnueabihf, powerpc-unknown-linux-gnu, powerpc64-unknown-linux-gnu, powerpc64le-unknown-linux-gnu x86_64-rumprun-netbsd. These can be installed with tools such as multirust.
cargo init creates a new Cargo project in the current directory. It is otherwise like cargo new.
Cargo has configuration keys for -v and --color. verbose and color, respectively, go in the [term] section of .cargo/config.
Configuration keys that evaluate to strings or integers can be set via environment variables. For example the build.jobs key can be set via CARGO_BUILD_JOBS. Environment variables take precedence over config files.
Target-specific dependencies support Rust cfg syntax for describing targets so that dependencies for multiple targets can be specified together. RFC 1361.
The child process tree is killed on Windows when Cargo is killed.
The build.target configuration value sets the target platform, like --target.
Unstable compiler flags have been further restricted. Since 1.0 -Z flags have been considered unstable, and other flags that were considered unstable additionally required passing -Z unstable-options to access. Unlike unstable language and library features though, these options have been accessible on the stable release channel. Going forward, new unstable flags will not be available on the stable release channel, and old unstable flags will warn about their usage. In the future, all unstable flags will be unavailable on the stable release channel.
It is no longer possible to match on empty enum variants using the Variant(..) syntax. This has been a warning since 1.6.
The Unix-specific MetadataExt traits, including os::unix::fs::MetadataExt, which expose values such as inode numbers no longer return platform-specific types, but instead return widened integers. RFC 1415.
On Unix, stack overflow triggers a runtime abort instead of a SIGSEGV.
Tuple and unit enum variants from other crates are in the type namespace.
On Windows rustc emits .lib files for the staticlib library type instead of .a files. Additionally, for the MSVC toolchain, rustc emits import libraries named foo.dll.lib instead of foo.lib.
The #[deprecated] attribute when applied to an API will generate warnings when used. The warnings may be suppressed with #[allow(deprecated)]. RFC 1270.
fn item types are zero sized, and each fn names a unique type. This will break code that transmutes fns, so calling transmute on a fn type will generate a warning for a few cycles, then will be converted to an error.
The parser considers unicode codepoints in the PATTERN_WHITE_SPACE category to be whitespace.
std::panic::catch_unwind (renamed from recover)
std::panic::resume_unwind (renamed from propagate)
std::panic::AssertUnwindSafe (renamed from AssertRecoverSafe)
std::panic::UnwindSafe (renamed from RecoverSafe)
std::sync::Once is poisoned if its initialization function fails.
The default buffer size used by BufReader and BufWriter was reduced to 8K, from 64K. This is in line with the buffer size used by other languages.
Instant, SystemTime and Duration implement += and -=. Duration additionally implements *= and /=.
Top-level overrides allow specific revisions of crates to be overridden through the entire crate graph. This is intended to make upgrades easier for large projects, by allowing crates to be forked temporarily until they've been upgraded and republished.
Cargo will pass the contents of the RUSTFLAGS variable to rustc on the commandline. rustc arguments can also be specified in the build.rustflags configuration key.
The time complexity of comparing variables for equivalence during type unification is reduced from O(n!) to O(n). This leads to major compilation time improvement in some scenarios.
ToString is specialized for str, giving it the same performance as to_owned.
Spawning processes with Command::output no longer creates extra threads.
#[derive(PartialEq)] and #[derive(PartialOrd)] emit less code for C-like enums.
Passing the --quiet flag to a test runner will produce much-abbreviated output.
The Rust Project now publishes std binaries for the mips-unknown-linux-musl, mipsel-unknown-linux-musl, and i586-pc-windows-msvc targets.
std::sync::Once is poisoned if its initialization function fails.
It is illegal to define methods with the same name in overlapping inherent impl blocks.
fn item types are zero sized, and each fn names a unique type. This will break code that transmutes fns, so calling transmute on a fn type will generate a warning for a few cycles, then will be converted to an error.
Improvements to const evaluation may trigger new errors when integer literals are out of range.
Copy types are required to have a trivial implementation of Clone. RFC 1521.
Fix #[derive(RustcEncodable)] in the presence of other encode methods.
panic! can be converted to a runtime abort with the -C panic=abort flag. RFC 1513.
Add a new crate type, 'cdylib'. cdylibs are dynamic libraries suitable for loading by non-Rust hosts. RFC 1510. Note that Cargo does not yet directly support cdylibs.
os::windows::fs::OpenOptionsExt::access_mode
os::windows::fs::OpenOptionsExt::share_mode
os::windows::fs::OpenOptionsExt::custom_flags
os::windows::fs::OpenOptionsExt::attributes
os::windows::fs::OpenOptionsExt::security_qos_flags
os::unix::fs::OpenOptionsExt::custom_flags
Default for sync::Weak
sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange
sync::atomic::Atomic{Usize,Isize,Bool,Ptr}::compare_exchange_weak
collections::{btree,hash}_map::{Occupied,Vacant,}Entry::key
os::unix::net::{UnixStream, UnixListener, UnixDatagram, SocketAddr}
Read/Write/RawFd impls for UnixStream
RawFd impls for UnixListener
RawFd impls for UnixDatagram
{BTree,Hash}Map::values_mut
The abs_sub method of floats is deprecated. The semantics of this minor method are subtle and probably not what most people want.
Add implementation of Ord for Cell
Implement Default for UnsafeCell, fmt::Error, Condvar, Mutex, RwLock.
Cargo.toml supports the profile.*.panic option. This controls the runtime behavior of the panic! macro and can be either "unwind" (the default), or "abort". RFC 1513.
Retry network requests. By default they are retried twice, which can be customized with the net.retry value in .cargo/config.
Prefer building cargo install artifacts in temporary directories. Makes it possible to install multiple crates in parallel.
rustc memory usage was reduced by refactoring the context used for type checking.
Speed up creation of HashMaps by caching the random keys used to initialize the hash state.
Trait selection optimizations speed up type checking by 15%.
Efficient trie lookup for boolean Unicode properties. 10x faster than the previous lookup tables.
Many incremental improvements to documentation and rustdoc.
Indexing with the wrong type produces a more informative error.
Improve diagnostics for constants being used in irrefutable patterns.
When many method candidates are in scope limit the suggestions to 10.
This release includes std binaries for the i586-unknown-linux-gnu, i686-unknown-linux-musl, and armv7-linux-androideabi targets. The i586 target is for old x86 hardware without SSE2, and the armv7 target is for Android running on modern ARM architectures.
The rust-gdb and rust-lldb scripts are distributed on all Unix platforms.
On Unix the runtime aborts by calling libc::abort instead of generating an illegal instruction.
target_env for Linux ARM targets is just gnu, not gnueabihf, gnueabi, etc.
Add :block to the follow set for :ty and :path. Affects how macros are parsed.
Feature-gated attributes on macro-generated macro invocations are now rejected.
Suppress fallback and ambiguity errors during type inference. This caused some minor changes to type inference.
f32::to_degrees (in libcore - previously stabilized in libstd)
f32::to_radians (in libcore - previously stabilized in libstd)
f64::to_degrees (in libcore - previously stabilized in libstd)
f64::to_radians (in libcore - previously stabilized in libstd)
Build scripts can emit warnings, and -vv prints warnings for all crates.
Don't warn about package.metadata keys. This provides room for expansion by arbitrary tools.
Caching projections speeds up type check dramatically for some workloads
The default HashMap hasher is SipHash 1-3 instead of SipHash 2-4 This hasher is faster, but is believed to provide sufficient protection from collision attacks.
Many more errors have been given error codes and extended explanations
API documentation continues to be improved, with many new examples
rustc no longer hangs when dependencies recursively re-export submodules
The 'How Safe and Unsafe Interact' chapter of The Rustonomicon was rewritten
rustc support 16-bit pointer sizes. No targets use this yet, but it works toward AVR support.
The new follow-set rules that place restrictions on macro_rules! in order to ensure syntax forward-compatibility have been enabled This was an amendment to RFC 550, and has been a warning since 1.10.
cfg attribute process has been refactored to fix various bugs. This causes breakage in some corner cases.
rustc translates code to LLVM IR via its own "middle" IR (MIR). This translation pass is far simpler than the previous AST->LLVM pass, and creates opportunities to perform new optimizations directly on the MIR. It was previously described on the Rust blog.
rustc presents a new, more readable error format, along with machine-readable JSON error output for use by IDEs. Most common editors supporting Rust have been updated to work with it. It was previously described on the Rust blog.
rustc translates code to LLVM IR via its own "middle" IR (MIR). This translation pass is far simpler than the previous AST->LLVM pass, and creates opportunities to perform new optimizations directly on the MIR. It was previously described on the Rust blog.
Print the Rust target name, not the LLVM target name, with --print target-list
The mips-unknown-linux-gnu target uses hardware floating point by default
rustc supports three new MUSL targets on ARM: arm-unknown-linux-musleabi, arm-unknown-linux-musleabihf, and armv7-unknown-linux-musleabihf. These targets produce statically-linked binaries. There are no binary release builds yet though.
rustc presents a new, more readable error format, along with machine-readable JSON error output for use by IDEs. Most common editors supporting Rust have been updated to work with it. It was previously described on the Rust blog.
In error descriptions, references are now described in plain English, instead of as "&-ptr"
In error type descriptions, unknown numeric types are named {integer} or {float} instead of _
rustc emits a clearer error when inner attributes follow a doc comment
macro_rules! invocations can be made within macro_rules! invocations
macro_rules! tt matchers can be reparsed correctly, making them much more useful
macro_rules! stmt matchers correctly consume the entire contents when inside non-braces invocations
Semicolons are properly required as statement delimiters inside macro_rules! invocations
ExitStatusExt::from_raw. Both on Unix and Windows.
The format! macro and friends now allow a single argument to be formatted in multiple styles
Cell, RefCell and UnsafeCell implement From for their contained type
vec_deque::Drain, hash_map::Drain and hash_set::Drain are covariant
Sockets on Linux are correctly closed in subprocesses via SOCK_CLOEXEC
hash_map::Entry, hash_map::VacantEntry and hash_map::OccupiedEntry implement Debug
btree_map::Entry, btree_map::VacantEntry and btree_map::OccupiedEntry implement Debug
mpsc::sync_channel Receivers return any available message before reporting a disconnect
The test runner now emits a warning when tests run over 60 seconds
Rust releases now come with source packages that can be installed by rustup via rustup component add rust-src. The resulting source code can be used by tools and IDES, located in the sysroot under lib/rustlib/src.
Many minor improvements to the documentation.
The Rust exception handling "personality" routine is now written in Rust
ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381
rustc 1.12.0 fails with SIGSEGV in release mode (syn crate 0.8.0)
Rustc 1.12.0 Windows build of ethcore crate fails with LLVM error
1.12.0: High memory usage when linking in release mode with debug info
Fix ICE: inject bitcast if types mismatch for invokes/calls/stores
debuginfo: Handle spread_arg case in MIR-trans in a more stable way.
Stabilize the ? operator. ? is a simple way to propagate errors, like the try! macro, described in RFC 0243.
Stabilize macros in type position. Described in RFC 873.
Stabilize attributes on statements. Described in RFC 0016.
Do not emit "class method" debuginfo for types that are not DICompositeType
Improve rlib metadata format. Reduces rlib size significantly.
Buffer unix and lock windows to prevent message interleaving
Many minor improvements
Only instantiate #[inline] functions in codegen units referencing them. This leads to big improvements in cases where crates export define many inline functions without using them directly.
Make vec_deque::Drain, hash_map::Drain, and hash_set::Drain covariant
Fix illegal instruction caused by overflow in channel cloning
When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno
SipHasher is deprecated. Use DefaultHasher.
Work around pointer aliasing issue in Vec::extend_from_slice, extend_with_element
This release includes security fixes to both curl and OpenSSL.
Make crates-io registry URL optional in config; ignore all changes to source.crates-io
SipHasher is deprecated. Use DefaultHasher.
Deny (by default) transmuting from fn item types to pointer-sized types. Continuing the long transition to zero-sized fn items, per RFC 401.
Fix #[derive] for empty tuple structs/variants. Part of RFC 1506.
Issue deprecation warnings for safe accesses to extern statics
println!(), with no arguments, prints newline. Previously, an empty string was required to achieve the same.
Wrapping impls standard binary and unary operators, as well as the Sum and Product iterators
Improve fold performance for chain, cloned, map, and VecDeque iterators
Add Iterator trait TrustedLen to enable better FromIterator / Extend
This release includes host (rustc) builds for Linux on MIPS, PowerPC, and S390x. These are tier 2 platforms and may have major defects. Follow the instructions on the website to install, or add the targets to an existing installation with rustup target add. The new target triples are:
mips-unknown-linux-gnu
mipsel-unknown-linux-gnu
mips64-unknown-linux-gnuabi64
mips64el-unknown-linux-gnuabi64
powerpc-unknown-linux-gnu
powerpc64-unknown-linux-gnu
powerpc64le-unknown-linux-gnu
s390x-unknown-linux-gnu
This release includes target (std) builds for ARM Linux running MUSL libc. These are tier 2 platforms and may have major defects. Add the following triples to an existing rustup installation with rustup target add:
arm-unknown-linux-musleabi
arm-unknown-linux-musleabihf
armv7-unknown-linux-musleabihf
This release includes experimental support for WebAssembly, via the wasm32-unknown-emscripten target. This target is known to have major defects. Please test, report, and fix.
rustup no longer installs documentation by default. Run rustup component add rust-docs to install.
Impls specifying extra region requirements beyond the trait they implement are rejected
Enums may not be unsized. Unsized enums are intended to work but never have. For now they are forbidden.
Enforce the shadowing restrictions from RFC 1560 for today's macros
Basic procedural macros allowing custom #[derive], aka "macros 1.1", are stable. This allows popular code-generating crates like Serde and Diesel to work ergonomically. RFC 1681.
Tuple structs may be empty. Unary and empty tuple structs may be instantiated with curly braces. Part of RFC 1506.
A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the legacy_imports lint since 1.14, with no known regressions.
In macro_rules, path fragments can now be parsed as type parameter bounds
On Windows, the compiler will apply dllimport attributes when linking to extern functions. Additional attributes and flags can control which library kind is linked and its name. RFC 1717.
The -C no-stack-check flag is deprecated. It does nothing.
Only report one error for all unused imports in an import list
The standard sorting algorithm has been rewritten for dramatic performance improvements. It is a hybrid merge sort, drawing influences from Timsort. Previously it was a naive merge sort.
Extend<&T> is specialized for Vec where T: Copy to improve performance.
chars().count() is much faster and so are chars().last() and char_indices().last()
In this release, Cargo build scripts no longer have access to the OUT_DIR environment variable at build time via env!("OUT_DIR"). They should instead check the variable at runtime with std::env. That the value was set at build time was a bug, and incorrect when cross-compiling. This change is known to cause breakage.
Assume build.rs in the same directory as Cargo.toml is a build script
Fix --message-format JSON when rustc emits non-JSON warnings
The Rust build system is now written in Rust. The Makefiles may continue to be used in this release by passing --disable-rustbuild to the configure script, but they will be deleted soon. Note that the new build system uses a different on-disk layout that will likely affect any scripts building Rust.
Rust supports i686-unknown-openbsd. Tier 3 support. No testing or releases.
Rust supports the MSP430. Tier 3 support. No testing or releases.
Rust supports the ARMv5TE architecture. Tier 3 support. No testing or releases.
A number of minor changes to name resolution have been activated. They add up to more consistent semantics, allowing for future evolution of Rust macros. Specified in RFC 1560, see its section on "changes" for details of what is different. The breaking changes here have been transitioned through the legacy_imports lint since 1.14, with no known regressions.
In this release, Cargo build scripts no longer have access to the OUT_DIR environment variable at build time via env!("OUT_DIR"). They should instead check the variable at runtime with std::env. That the value was set at build time was a bug, and incorrect when cross-compiling. This change is known to cause breakage.
Higher-ranked lifetimes are no longer allowed to appear only in associated types. The hr_lifetime_in_assoc_type lint has been a warning since 1.10 and is now an error by default. It will become a hard error in the near future.
The semantics relating modules to file system directories are changing in minor ways. This is captured in the new legacy_directory_ownership lint, which is a warning in this release, and will become a hard error in the future.
Once Peekable peeks a None it will return that None without re-querying the underlying iterator
rustc now supports --emit=metadata, which causes rustc to emit a .rmeta file containing only crate metadata. This can be used by tools like the Rust Language Service to perform metadata-only builds.
Levenshtein based typo suggestions now work in most places, while previously they worked only for fields and sometimes for local variables. Together with the overhaul of "no resolution"/"unexpected resolution" errors (#38154) they result in large and systematic improvement in resolution diagnostics.
rustc no longer attempts to provide "consider using an explicit lifetime" suggestions. They were inaccurate.
CommandExt::creation_flags
[T]::binary_search and [T]::binary_search_by_key now take their argument by Borrow parameter
Ctrl-Z returns from Stdin.read() when reading from the console on Windows
TcpListener::set_only_v6 is deprecated. This functionality cannot be achieved in std currently.
rustdoc has a --sysroot argument that, like rustc, specifies the path to the Rust implementation
The armv7-linux-androideabi target no longer enables NEON extensions, per Google's ABI guide
Rust has initial SPARC support. Tier 3. No builds available.
Rust has experimental support for Nvidia PTX. Tier 3. No builds available.
Uninhabitable enums (those without any variants) no longer permit wildcard match patterns
In this release, references to uninhabited types can not be pattern-matched. This was accidentally allowed in 1.15.
The compiler's dead_code lint now accounts for type aliases.
Ctrl-Z returns from Stdin.read() when reading from the console on Windows
Reimplemented lifetime elision. This change was almost entirely compatible with existing code, but it did close a number of small bugs and loopholes, as well as being more accepting in some other cases.
The lifetime of statics and consts defaults to 'static. RFC 1623
Fields of structs may be initialized without duplicating the field/variable names. RFC 1682
When coercing to an unsized type lifetimes must be equal. That is, there is no subtyping between T and U when T: Unsize<U>. For example, coercing &mut [&'a X; N] to &mut [&'b X] requires 'a be equal to 'b. Soundness fix.
Values passed to the indexing operator, [], automatically coerce
Add -C overflow-checks to directly control whether integer overflow panics
The rustc type checker now checks items on demand instead of in a single in-order pass. This is mostly an internal refactoring in support of future work, including incremental type checking, but also resolves RFC 1647, allowing Self to appear in impl where clauses.
Strip exception handling code on Emscripten when panic=abort
Box implements a number of new conversions:
From<Box<str>> for String,
From<Box<[T]>> for Vec
Add ToString trait specialization for Cow<'a, str> and String
Box<[T]> implements From<&[T]> where T: Copy, Box<str> implements From<&str>
format! estimates the needed capacity before writing a string
HashMap resizes adaptively to guard against DOS attacks and poor hash functions.
Documentation is rendered with mdbook instead of the obsolete, in-tree rustbook
Configure build correctly on 64-bit CPU's with the armhf ABI
rustc is linked statically on Windows MSVC targets, allowing it to run without installing the MSVC runtime.
This release includes builds of std for sparc64-unknown-linux-gnu, aarch64-unknown-linux-fuchsia, and x86_64-unknown-linux-fuchsia.
This release no longer includes the old makefile build system. Rust is built with a custom build system, written in Rust, and with Cargo.
The Rust source includes NatVis visualizations. These can be used by WinDbg and Visual Studio to improve the debugging experience.
Rust 1.17 does not correctly detect the MSVC 2017 linker. As a workaround, either use MSVC 2015 or run vcvars.bat.
When coercing to an unsized type lifetimes must be equal. That is, disallow subtyping between T and U when T: Unsize<U>, e.g. coercing &mut [&'a X; N] to &mut [&'b X] requires 'a be equal to 'b. Soundness fix.
format! and Display::to_string panic if an underlying formatting implementation returns an error. Previously the error was silently ignored. It is incorrect for write_fmt to return an error when writing to a string.
In-tree crates are verified to be unstable. Previously, some minor crates were marked stable and could be accessed from the stable toolchain.
Rust git source no longer includes vendored crates. Those that need to build with vendored crates should build from release tarballs.
During crate resolution, rustc prefers a crate in the sysroot if two crates are otherwise identical. Unlikely to be encountered outside the Rust build system.
Fixed bugs around how type inference interacts with dead-code. The existing code generally ignores the type of dead-code unless a type-hint is provided; this can cause surprising inference interactions particularly around defaulting. The new code uniformly ignores the result type of dead-code.
Tuple-struct constructors with private fields are no longer visible
Lifetime parameters that do not appear in the arguments are now considered early-bound, resolving a soundness bug (#32330). The hr_lifetime_in_assoc_type future-compatibility lint has been in effect since April of 2016.
Make transmuting from fn item types to pointer-sized types a hard error
Stabilize pub(restricted) pub can now accept a module path to make the item visible to just that module tree. Also accepts the keyword crate to make something public to the whole crate but not users of the library. Example: pub(crate) mod utils;. RFC 1422.
Stabilize #![windows_subsystem] attribute conservative exposure of the /SUBSYSTEM linker flag on Windows platforms. RFC 1665.
Refactor of trait object type parsing Now ty in macros can accept types like Write + Send, trailing + are now supported in trait objects, and better error reporting for trait objects starting with ?Sized.
Added explanation for E0090(Wrong number of lifetimes are supplied)
rustc compilation is now 15%-20% faster Thanks to optimisation opportunities found through profiling
Specialized Vec::from_iter being passed vec::IntoIter if the iterator hasn't been advanced the original Vec is reassembled with no actual iteration or reallocation.
Simplified HashMap Bucket interface provides performance improvements for iterating and cloning.
Optimized insertion sort in slice insertion sort in some cases 2.50%~ faster and in one case now 12.50% faster.
Added partial Pijul support Pijul is a version control system in Rust. You can now create new cargo projects with Pijul using cargo new --vcs pijul
Now always emits build script warnings for crates that fail to build
Added --bins and --tests flags now you can build all programs of a certain type, for example cargo build --bins will build all binaries.
Changes to how the 0 flag works in format! Padding zeroes are now always placed after the sign if it exists and before the digits. With the # flag the zeroes are placed after the prefix and before the digits.
Due to the struct field optimisation, using transmute on structs that have no repr attribute or #[repr(Rust)] will no longer work. This has always been undefined behavior, but is now more likely to break in practice.
The refactor of trait object type parsing fixed a bug where + was receiving the wrong priority parsing things like &for<'a> Tr<'a> + Send as &(for<'a> Tr<'a> + Send) instead of (&for<'a> Tr<'a>) + Send
rustc main.rs -o out --emit=asm,llvm-ir Now will output out.asm and out.ll instead of only one of the filetypes.
calling a function that returns Self will no longer work when the size of Self cannot be statically determined.
rustc now builds with a "pthreads" flavour of MinGW for Windows GNU this has caused a few regressions namely:
Changed the link order of local static/dynamic libraries (respecting the order on given rather than having the compiler reorder).
Changed how MinGW is linked, native code linked to dynamic libraries may require manually linking to the gcc support library (for the native code itself)
Numeric fields can now be used for creating tuple structs. RFC 1506 For example struct Point(u32, u32); let x = Point { 0: 7, 1: 0 };.
loop can now return a value with break. RFC 1624 For example: let x = loop { break 7; };
C compatible unions are now available. RFC 1444 They can only contain Copy types and cannot have a Drop implementation. Example: union Foo { bar: u8, baz: usize }
Non capturing closures can now be coerced into fns, RFC 1558 Example: let foo: fn(u8) -> u8 = |v: u8| { v };
Add support for bootstrapping the Rust compiler toolchain on Android.
Change arm-linux-androideabi to correspond to the armeabi official ABI. If you wish to continue targeting the armeabi-v7a ABI you should use --target armv7-linux-androideabi.
Fixed ICE when removing a source file between compilation sessions.
Compiler error message is now aborting due to previous error(s) instead of aborting due to N previous errors This was previously inaccurate and would only count certain kinds of errors.
Added target-feature=+crt-static option RFC 1721 Which allows libraries with C Run-time Libraries(CRT) to be statically linked.
[u8]::reverse is now 5x faster and [u16]::reverse is now 1.5x faster
eprint! and eprintln! macros added to prelude. Same as the print! macros, but for printing to stderr.
Subcommands now replace the current process rather than spawning a new child process
Cargo no longer checks out a local working directory for the crates.io index This should provide smaller file size for the registry, and improve cloning times, especially on Windows machines.
Added an --exclude option for excluding certain packages when using the --all option
Cargo will now automatically retry when receiving a 5xx error from crates.io
The --features option now accepts multiple comma or space delimited values.
Added rust-windbg.cmd for loading rust .natvis files in the Windows Debugger.
rustup will now prefer to download rust packages with XZ compression over GZip packages.
Added the ability to escape # in rust documentation By adding additional #'s ie. ## is now #
-Z flags are now no longer allowed to be used on the stable compiler. This has been a warning for a year previous to this.
As a result of the -Z flag change, the cargo-check plugin no longer works. Users should migrate to the built-in check command, which has been available since 1.16.
Ending a float literal with ._ is now a hard error. Example: 42._ .
Any use of a private extern crate outside of its module is now a hard error. This was previously a warning.
use ::self::foo; is now a hard error. self paths are always relative while the :: prefix makes a path absolute, but was ignored and the path was relative regardless.
Floating point constants in match patterns is now a hard error This was previously a warning.
Struct or enum constants that don't derive PartialEq & Eq used match patterns is now a hard error This was previously a warning.
Lifetimes named '_ are no longer allowed. This was previously a warning.
From the pound escape, lines consisting of multiple #s are now visible
It is an error to re-export private enum variants. This is known to break a number of crates that depend on an older version of mustache.
Struct fields are now properly coerced to the expected field type.
Enabled wasm LLVM backend WASM can now be built with the wasm32-experimental-emscripten target.
Add support for RELRO(RELocation Read-Only) for platforms that support it.
rustc now reports the total number of errors on compilation failure previously this was only the number of errors in the pass that failed.
rustc will now suggest one-argument enum variant to fix type mismatch when applicable
Relaxed Debug constraints on {HashMap,BTreeMap}::{Keys,Values}.
Impl PartialEq, Eq, PartialOrd, Ord, Debug, Hash for unsized tuples.
Impl fmt::{Display, Debug} for Ref, RefMut, MutexGuard, RwLockReadGuard, RwLockWriteGuard
Fixed how {f32, f64}::{is_sign_negative, is_sign_positive} handles NaN.
allow messages in the unimplemented!() macro. ie. unimplemented!("Waiting for 1.21 to be stable")
pub(restricted) is now supported in the thread_local! macro.
Reimplemented {f32, f64}::{min, max} in Rust instead of using CMath.
Iterator::nth for ops::{Range, RangeFrom} is now done in O(1) time
#[repr(align(N))] attribute max number is now 2^31 - 1. This was previously 2^15.
{OsStr, Path}::Display now avoids allocations where possible
Cargo API token location moved from ~/.cargo/config to ~/.cargo/credentials.
Cargo will now build main.rs binaries that are in sub-directories of src/bin. ie. Having src/bin/server/main.rs and src/bin/client/main.rs generates target/debug/server and target/debug/client
You can now specify version of a binary when installed through cargo install using --vers.
Added --no-fail-fast flag to cargo to run all benchmarks regardless of failure.
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
Now runs LLVM in parallel during translation phase. This should reduce peak memory usage.
Cargo commands inside a virtual workspace will now implicitly pass --all
Added a [patch] section to Cargo.toml to handle prepublication dependencies RFC 1969
include & exclude fields in Cargo.toml now accept gitignore like patterns
Using required dependencies as a feature is now deprecated and emits a warning
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 showed std::os::unix.
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 library libsyntax to correctly use.
rustc now defaults to having 16 codegen units at debug on supported platforms.
rustc will no longer inline in codegen units when compiling for debug This should decrease compile times for debug builds.
Allow atomic operations up to 32 bits on armv5te_unknown_linux_gnueabi
Option
Changed [root] to [package] in Cargo.lock Packages with the old format will continue to work and can be updated with cargo update.
Stabilised the compile_fail attribute for code fences in doc-comments. This now lets you specify that a given code example will fail to compile.
rustc now uses subtyping on the left hand side of binary operations. Which should fix some confusing errors in some operations.
Removed T: Sized requirement for {<*const T>, <*mut T>}::as_ref and <*mut T>::as_mut
Copied AsciiExt trait methods to primitive types. Use of AsciiExt is now deprecated.
Cargo now supports uninstallation of multiple packages eg. cargo uninstall foo bar uninstalls foo and bar.
Cargo now lets you install a specific version using cargo install --version
Changes have been made to type equality to make it more correct, in rare cases this could break some code. Tracking issue for further information
Upgraded Android SDK to 27, and NDK to r15c. This drops support for Android 9, the minimum supported version is Android 14.
External sysv64 ffi is now available. eg. extern "sysv64" fn foo () {}
rustc now uses 16 codegen units by default for release builds. For the fastest builds, utilize codegen-units=1.
str::find::
OsStr's Debug implementation is now lossless and consistent with Windows.
float::from_bits now just uses transmute. This provides some optimisations from LLVM.
Optimised f32::{min, max} to generate more efficient x86 assembly
[u8]::contains now uses memchr which provides a 3x speed improvement
The following functions can now be used in a constant expression. eg. let buffer: [u8; size_of::<usize>()];, static COUNTER: AtomicUsize = AtomicUsize::new(1);
Added a workspace.default-members config that overrides implied --all in virtual workspaces.
Enable incremental by default on development builds. Also added configuration keys to Cargo.toml and .cargo/config to disable on a per-project or global basis respectively.
Floating point types Debug impl now always prints a decimal point.
Ipv6Addr now rejects superfluous ::'s in IPv6 addresses This is in accordance with IETF RFC 4291 §2.2.
Unwinding will no longer go past FFI boundaries, and will instead abort.
Formatter::flags method is now deprecated. The sign_plus, sign_minus, alternate, and sign_aware_zero_pad should be used instead.
You can now use nested groups of imports. e.g. use std::{fs::File, io::Read, path::{Path, PathBuf}};
enum Foo { A, B, C } fn main() { let x = Foo::A; match x { | Foo::A | Foo::B => println!("AB"), | Foo::C => println!("C"), } }
The following functions can now be used in a constant expression. eg. static MINUTE: Duration = Duration::from_secs(60);
rustdoc has switched to pulldown as the default markdown renderer.
The borrow checker was sometimes incorrectly permitting overlapping borrows around indexing operations (see #47349). This has been fixed (which also enabled some correct code that used to cause errors (e.g. #33903 and #46095).
Closures now implement Copy and/or Clone if all captured variables implement either or both traits.
The inclusive range syntax e.g. for x in 0..=10 is now stable.
impl Trait is now stable allowing you to have abstract types in returns or in function parameters. E.g. fn foo() -> impl Iterator<Item=u8> or fn open(path: impl AsRef<Path>).
128-bit integers in the form of u128 and i128 are now stable.
main can now return Result<(), E: Debug> in addition to ().
A lot of operations are now available in a const context. E.g. You can now index into constant arrays, reference and dereference into constants, and use tuple struct constructors.
Fixed entry slice patterns are now stable. E.g.
let points = [1, 2, 3, 4]; match points { [1, 2, 3, 4] => println!("All points were sequential."), _ => println!("Not all points were sequential."), }
LLD is now used as the default linker for wasm32-unknown-unknown.
Fixed exponential projection complexity on nested types. This can provide up to a ~12% reduction in compile times for certain crates.
Added the --remap-path-prefix option to rustc. Allowing you to remap path prefixes outputted by the compiler.
Implemented From<u16> for usize & From<{u8, i16}> for isize.
Added hexadecimal formatting for integers with fmt::Debug e.g. assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]")
aliasing a Fn trait as dyn no longer works. E.g. the following syntax is now invalid.
use std::ops::Fn as dyn; fn g(_: Box) {}
The result of dereferences are no longer promoted to 'static. e.g.
fn main() { const PAIR: &(i32, i32) = &(0, 1); let _reversed_pair: &'static _ = &(PAIR.1, PAIR.0); // Doesn't work }
".e0" will now no longer parse as 0.0 and will instead cause an error.
Removed 'proc' from the reserved keywords list. This allows proc to be used as an identifier.
The dyn syntax is now available. 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
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.
SIMD (Single Instruction Multiple Data) on x86/x86_64 is now stable. 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.
The generic Rhs type parameter on ops::{Shl, ShlAssign, Shr} now defaults to Self.
std::str::replace now has the #[must_use] attribute to clarify that the operation isn't done in place.
Clone::clone, Iterator::collect, and ToOwned::to_owned now have the #[must_use] attribute to warn about unused potentially expensive allocations.
cargo-metadata now includes authors, categories, keywords, readme, and repository fields.
Added the --target-dir optional argument. 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. 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=0 in your environment.
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.org are now searchable.
Calling a CharExt or StrExt method directly on core will no longer work. 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. E.g. print!("{:?}", AtomicBool::new(true)) will print true, not AtomicBool(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 the std::error::Error trait has been soft-deprecated. It is no longer required to implement it.
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.
The borrow checker was fixed to avoid potential unsoundness when using match ergonomics: #52213.
The #[repr(transparent)] attribute is now stable. This attribute
allows a Rust newtype wrapper (struct NewType
The GlobalAlloc trait and #[global_allocator] attribute are now stable. This will allow users to specify a global allocator for their program.
The lifetime specifier for macro_rules! is now stable. This allows macros to easily target lifetimes.
The s and z optimisation levels are now stable. These optimisations prioritise making smaller binary sizes. z is the same as s with the exception that it does not vectorise loops, which typically results in an even smaller binary.
The short error format is now stable. Specified with --error-format=short this option will provide a more compressed output of rust error messages.
Added a lint warning when you have duplicated macro_exports.
Reduced the number of allocations in the macro parser. This can improve compile times of macro heavy crates on average by 5%.
Implemented From<bool> for all integer and unsigned number types.
The Debug implementation of time::Duration should now be more easily human readable. Previously a Duration of one second would printed as Duration { secs: 1, nanos: 0 } and will now be printed as 1s.
Implemented Shl and Shr for Wrapping<u128> and Wrapping<i128>.
DirEntry::metadata now uses fstatat instead of lstat when possible. This can provide up to a 40% speed increase.
Cargo will now no longer allow you to publish crates with build scripts that modify the src directory. The src directory in a crate should be considered to be immutable.
The suggestion_applicability field in rustc's json output is now stable. This will allow dev tools to check whether a code suggestion would apply to them.
Rust will consider trait objects with duplicated constraints to be the same type as without the duplicated constraint. For example the below code will now fail to compile.
trait Trait {} impl Trait + Send { fn test(&self) { println!("one"); } //~ ERROR duplicate definitions with name `test` } impl Trait + Send + Send { fn test(&self) { println!("two"); } }
Cargo can silently fix some bad lockfiles. You can use --locked to disable this behavior.
cargo-install will now allow you to cross compile an install using --target.
Added the cargo-fix subcommand to automatically move project code from 2015 edition to 2018.
cargo doc can now optionally document private types using the --document-private-items flag.
rustdoc now has the --cap-lints option which demotes all lints above the specified level to that level. For example --cap-lints warn will demote deny and forbid lints to warn.
rustc and rustdoc will now have the exit code of 1 if compilation fails and 101 if there is a panic.
A preview of clippy has been made available through rustup. You can install the preview with rustup component add clippy-preview.
str::{slice_unchecked, slice_unchecked_mut} are now deprecated. Use str::get_unchecked(begin..end) instead.
std::env::home_dir is now deprecated for its unintuitive behavior. Consider using the home_dir function from https://crates.io/crates/dirs instead.
rustc will no longer silently ignore invalid data in target spec.
cfg attributes and --cfg command line flags are now more strictly validated.
The standard library's str::repeat function contained an out of bounds write caused by an integer overflow. This has been fixed by deterministically panicking when an overflow happens.
Thank you to Scott McMurray for responsibly disclosing this vulnerability to us.
Workaround for an aliasing-related LLVM bug, which caused miscompilation.
The rls-preview component on the windows-gnu targets has been restored.
Procedural macros are now available. These kinds of macros allow for more powerful code generation. There is a new chapter available in the Rust Programming Language book that goes further in depth.
You can now use keywords as identifiers using the raw identifiers syntax (r#), e.g. let r#for = true;
You can now use crate in paths. This allows you to refer to the crate root in the path, e.g. use crate::foo; refers to foo in src/lib.rs.
Using a external crate no longer requires being prefixed with ::. Previously, using a external crate in a module without a use statement required let json = ::serde_json::from_str(foo); but can now be written as let json = serde_json::from_str(foo);.
You can now apply the #[used] attribute to static items to prevent the compiler from optimising them away, even if they appear to be unused, e.g. #[used] static FOO: u32 = 1;
You can now import and reexport macros from other crates with the use syntax. Macros exported with #[macro_export] are now placed into the root module of the crate. If your macro relies on calling other local macros, it is recommended to export with the #[macro_export(local_inner_macros)] attribute so users won't have to import those macros.
You can now catch visibility keywords (e.g. pub, pub(crate)) in macros using the vis specifier.
Non-macro attributes now allow all forms of literals, not just strings. Previously, you would write #[attr("true")], and you can now write #[attr(true)].
The following methods are replacement methods for trim_left, trim_right, trim_left_matches, and trim_right_matches, which will be deprecated in 1.33.0:
cargo run doesn't require specifying a package in workspaces.
cargo doc now supports --message-format=json. This is equivalent to calling rustdoc --error-format=json.
rustdoc allows you to specify what edition to treat your code as with the --edition option.
We now distribute a rust-gdbgui script that invokes gdbgui with Rust debug symbols.
Attributes from Rust tools such as rustfmt or clippy are now available, e.g. #[rustfmt::skip] will skip formatting the next item.
🎉 This version marks the release of the 2018 edition of Rust. 🎉
New lifetime elision rules now allow for eliding lifetimes in functions and impl headers. E.g. impl<'a> Reader for BufReader<'a> {} can now be impl Reader for BufReader<'_> {}. Lifetimes are still required to be defined in structs.
You can now define and use const functions. These are currently a strict minimal subset of the const fn RFC. Refer to the language reference for what exactly is available.
You can now use tool lints, which allow you to scope lints from external tools using attributes. E.g. #[allow(clippy::filter_map)].
You can now use the ? operator in macro definitions. The ? operator allows you to specify zero or one repetitions similar to the * and + operators.
enum Color { Red, Green, Blue } use Color::*;
You can now match against literals in macros with the literal specifier. This will match against a literal of any type. E.g. 1, 'A', "Hello World"
Self can now be used as a constructor and pattern for unit and tuple structs. E.g.
struct Point(i32, i32); impl Point { pub fn new(x: i32, y: i32) -> Self { Self(x, y) } pub fn is_origin(&self) -> bool { match self { Self(0, 0) => true, _ => false, } } }
Self can also now be used in type definitions. E.g.
enum Listwhere Self: PartialOrd<Self> // can write `Self` instead of `List ` { Nil, Cons(T, Box<Self>) // likewise here }
You can now mark traits with #[must_use]. This provides a warning if a impl Trait or dyn Trait is returned and unused in the program.
The default allocator has changed from jemalloc to the default allocator on your system. The compiler itself on Linux & macOS will still use jemalloc, but programs compiled with it will use the system allocator.
The dbg! macro has been stabilized. This macro enables you to easily debug expressions in your rust program. E.g.
let a = 2; let b = dbg!(a * 2) + 1; // ^-- prints: [src/main.rs:4] a * 2 = 4 assert_eq!(b, 5);
The following APIs are now const functions and can be used in a const context.
The argument types for AVX's _mm256_stream_si256, _mm256_stream_pd, _mm256_stream_ps have been changed from *const to *mut as the previous implementation was unsound.
You can now use the cfg(target_vendor) attribute. E.g. #[cfg(target_vendor="apple")] fn main() { println!("Hello Apple!"); }
Integer patterns such as in a match expression can now be exhaustive. E.g. You can have match statement on a u8 that covers 0..=255 and you would no longer be required to have a _ => unreachable!() case.
You can now have multiple patterns in if let and while let expressions. You can do this with the same syntax as a match expression. E.g.
enum Creature { Crab(String), Lobster(String), Person(String), } fn main() { let state = Creature::Crab("Ferris"); if let Creature::Crab(name) | Creature::Person(name) = state { println!("This creature's name is: {}", name); } }
You can now have irrefutable if let and while let patterns. Using this feature will by default produce a warning as this behaviour can be unintuitive. E.g. if let _ = 5 {}
You can now call unsafe const functions. E.g.
const unsafe fn foo() -> i32 { 5 } const fn bar() -> i32 { unsafe { foo() } }
You can now specify multiple attributes in a cfg_attr attribute. E.g. #[cfg_attr(all(), must_use, optimize)]
You can now specify a specific alignment with the #[repr(packed)] attribute. E.g. #[repr(packed(2))] struct Foo(i16, i32); is a struct with an alignment of 2 bytes and a size of 6 bytes.
You can now import an item from a module as an _. This allows you to import a trait's impls, and not have the name in the namespace. E.g.
use std::io::Read as _; // Allowed as there is only one `Read` in the module. pub trait Read {}
You can now set a linker flavor for rustc with the -Clinker-flavor command line argument.
The x86_64-fortanix-unknown-sgx target support has been upgraded to tier 2 support. Visit the platform support page for information on Rust's platform support.
Added support for the thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf targets.
The methods str::{trim_left, trim_right, trim_left_matches, trim_right_matches} are now deprecated in the standard library, and their usage will now produce a warning. Please use the str::{trim_start, trim_end, trim_start_matches, trim_end_matches} methods instead.
The Error::cause method has been deprecated in favor of Error::source which supports downcasting.
You can now use #[deprecated = "reason"] as a shorthand for #[deprecated(note = "reason")]. This was previously allowed by mistake but had no effect.
You can now accept token streams in #[attr()],#[attr[]], and #[attr{}] procedural macros.
You can now write extern crate self as foo; to import your crate's root into the extern prelude.
You can now target riscv64imac-unknown-none-elf and riscv64gc-unknown-none-elf.
You can now enable linker plugin LTO optimisations with -C linker-plugin-lto. This allows rustc to compile your Rust code into LLVM bitcode allowing LLVM to perform LTO optimisations across C/C++ FFI boundaries.
The trait bounds have been removed on some of HashMap
The Ord trait bounds have been removed on some of BinaryHeap
The methods overflowing_neg and wrapping_neg are now const functions for all numeric types.
Indexing a str is now generic over all types that implement SliceIndex<str>.
str::trim, str::trim_matches, str::trim_{start, end}, and str::trim_{start, end}_matches are now #[must_use] and will produce a warning if their returning type is unused.
The methods checked_pow, saturating_pow, wrapping_pow, and overflowing_pow are now available for all numeric types. These are equivalent to methods such as wrapping_add for the pow operation.
Command::before_exec is being replaced by the unsafe method Command::pre_exec and will be deprecated with Rust 1.37.0.
Use of ATOMIC_{BOOL, ISIZE, USIZE}_INIT is now deprecated as you can now use const functions in static variables.
FnOnce, FnMut, and the Fn traits are now implemented for Box
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(|| {}); } }
StdinLock, StdoutLock, and StderrLock now implement AsRawFd.
Expanded Debug output ({:#?}) for structs now has a trailing comma on the last field.
char::{ToLowercase, ToUppercase} now implement ExactSizeIterator.
Removed the Read trait bounds on the BufReader::{get_ref, get_mut, into_inner} methods.
In place ASCII case conversions are now up to 4× faster. e.g. str::make_ascii_lowercase
hash_map::{OccupiedEntry, VacantEntry} now implement Sync and Send.
You can now set cargo:rustc-cdylib-link-arg at build time to pass custom linker arguments when building a cdylib. Its usage is highly platform specific.
The order of traits in trait objects no longer affects the semantics of that object. e.g. dyn Send + fmt::Debug is now equivalent to dyn fmt::Debug + Send, where this was previously not the case.
HashMap's implementation has been replaced with hashbrown::HashMap implementation.
alloc::Layout::from_size_align_unchecked is now available as a const fn.
The alloc crate is now stable. alloc allows you to use a subset of std (e.g. Vec, Box, Arc) in #![no_std] environments if the environment has access to heap memory allocation.
You can now pass multiple arguments to the dbg! macro. dbg! will return a tuple of each argument when there is multiple arguments.
Result::{is_err, is_ok} are now #[must_use] and will produce a warning if not used.
You can find further change's in Cargo's 1.36.0 release notes.
There have been numerous additions and fixes to clippy, see Clippy's 1.36.0 release notes for more details.
With the stabilisation of mem::MaybeUninit, mem::uninitialized use is no longer recommended, and will be deprecated in 1.39.0.
#[must_use] will now warn if the type is contained in a tuple, Box, or an array and unused.
You can now use the cfg and cfg_attr attributes on generic parameters.
You can now use enum variants through type alias. e.g. You can write the following:
type MyOption = Option<u8>; fn increment_or_zero(x: MyOption) -> u8 { match x { MyOption::Some(y) => y + 1, MyOption::None => 0, } }
You can now use _ as an identifier for consts. e.g. You can write const _: u32 = 5;.
The ? Kleene macro operator is now available in the 2015 edition.
You can now enable Profile-Guided Optimization with the -C profile-generate and -C profile-use flags. For more information on how to use profile guided optimization, please refer to the rustc book.
Using ... for inclusive range patterns will now warn by default. Please transition your code to using the ..= syntax for inclusive ranges instead.
Using a trait object without the dyn will now warn by default. Please transition your code to use dyn Trait for trait objects instead.
Added pipelined compilation support to rustc. This will improve compilation times in some cases. For further information please refer to the "Evaluating pipelined rustc compilation" thread.
Added tier 3 support for the armv7-unknown-linux-gnueabi and armv7-unknown-linux-musleabi targets.
Added tier 3 support for the hexagon-unknown-linux-musl target.
Added tier 3 support for the riscv32i-unknown-none-elf target.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Derive macros for prelude traits (e.g. Clone, Debug, Hash) are now available at the same path as the trait. (e.g. The Clone derive macro is available at std::clone::Clone). This also makes all built-in macros available in std/core root. e.g. std::include_bytes!.
slice::{concat, connect, join} now accepts &[T] in addition to &T.
Added euclidean remainder and division operations (div_euclid, rem_euclid) to all numeric primitives. Additionally checked, overflowing, and wrapping versions are available for all integer primitives.
thread::AccessError now implements Clone, Copy, Eq, Error, and PartialEq.
iter::{StepBy, Peekable, Take} now implement DoubleEndedIterator.
The x86_64-unknown-uefi platform can not be built with rustc 1.38.0.
The armv7-unknown-linux-gnueabihf platform is known to have issues with certain crates such as libc.
You can now use certain attributes on function, closure, and function pointer parameters. These attributes include cfg, cfg_attr, allow, warn, deny, forbid as well as inert helper attributes used by procedural macro attributes applied to items. e.g.
fn len( #[cfg(windows)] slice: &[u16], #[cfg(not(windows))] slice: &[u8], ) -> usize { slice.len() }
You can now take shared references to bind-by-move patterns in the if guards of match arms. e.g.
fn main() { let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]); match array { nums // ---- `nums` is bound by move. if nums.iter().sum::<u8>() == 10 // ^------ `.iter()` implicitly takes a reference to `nums`. => { drop(nums); // ----------- Legal as `nums` was bound by move and so we have ownership. } _ => unreachable!(), } }
Added tier 3 support for the sparc64-unknown-openbsd target.
rustc will now trim code snippets in diagnostics to fit in your terminal. Note Cargo currently doesn't use this feature. Refer to cargo#7315 to track this feature's progress.
You can now pass --show-output argument to test binaries to print the output of successful tests.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
You can now publish git dependencies if supplied with a version.
The --all flag has been renamed to --workspace. Using --all is now deprecated.
Code that was previously accepted by the old borrow checker, but rejected by the NLL borrow checker is now a hard error in Rust 2018. This was previously a warning, and will also become a hard error in the Rust 2015 edition in the 1.40.0 release.
rustdoc now requires rustc to be installed and in the same directory to run tests. This should improve performance when running a large amount of doctests.
The try! macro will now issue a deprecation warning. It is recommended to use the ? operator instead.
asinh(-0.0) now correctly returns -0.0. Previously this returned 0.0.
You can now use tuple structs and tuple enum variant's constructors in const contexts. e.g.
pub struct Point(i32, i32); const ORIGIN: Point = { let constructor = Point; constructor(0, 0) };
You can now mark structs, enums, and enum variants with the #[non_exhaustive] attribute to indicate that there may be variants or fields added in the future. For example this requires adding a wild-card branch (_ => {}) to any match statements on a non-exhaustive enum. (RFC 2008)
You can now use function-like procedural macros in extern blocks and in type positions. e.g. type Generated = macro!();
The meta pattern matcher in macro_rules! now correctly matches the modern attribute syntax. For example (#[$m:meta]) now matches #[attr], #[attr{tokens}], #[attr[tokens]], and #[attr(tokens)].
Added tier 3 support* for the thumbv7neon-unknown-linux-musleabihf target.
Added tier 3 support for the aarch64-unknown-none-softfloat target.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
As previously announced, any previous NLL warnings in the 2015 edition are now hard errors.
The include! macro will now warn if it failed to include the entire file. The include! macro unintentionally only includes the first expression in a file, and this can be unintuitive. This will become either a hard error in a future release, or the behavior may be fixed to include all expressions as expected.
Using #[inline] on function prototypes and consts now emits a warning under unused_attribute lint. Using #[inline] anywhere else inside traits or extern blocks now correctly emits a hard error.
You can now pass type parameters to foreign items when implementing
traits. E.g. You can now write impl
You can now arbitrarily nest receiver types in the self position. E.g. you can now write fn foo(self: Box<Box<Self>>) {}. Previously only Self, &Self, &mut Self, Arc<Self>, Rc<Self>, and Box<Self> were allowed.
You can now use any valid identifier in a format_args macro. Previously identifiers starting with an underscore were not allowed.
Visibility modifiers (e.g. pub) are now syntactically allowed on trait items and enum variants. These are still rejected semantically, but can be seen and parsed by procedural macros and conditional compilation.
You can now define a Rust extern "C" function with Box
Added tier 3 support* for the riscv64gc-unknown-linux-gnu target.
You can now pass an arguments file passing the @path syntax to rustc. Note that the format differs somewhat from what is found in other tooling; please see the documentation for more information.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The core::panic module is now stable. It was already stable through std.
NonZero* numerics now implement From
Cargo will now document all the private items for binary crates by default.
cargo-install will now reinstall the package if it detects that it is out of date.
Cargo.lock now uses a more git friendly format that should help to reduce merge conflicts.
You can now override specific dependencies's build settings E.g. [profile.dev.package.image] opt-level = 2 sets the image crate's optimisation level to 2 for debug builds. You can also use [profile.<profile>.build-override] to override build scripts and their dependencies.
You can now specify edition in documentation code blocks to compile the block for that edition. E.g. edition2018 tells rustdoc that the code sample should be compiled the 2018 edition of Rust.
You can use #[cfg(doc)] to compile an item when building documentation.
As previously announced 1.41 will be the last tier 1 release for 32-bit Apple targets. This means that the source code is still available to build, but the targets are no longer being tested and release binaries for those platforms will no longer be distributed by the Rust project. Please refer to the linked blog post for more information.
Rust 1.41.0 was announced as the last Rust release with tier 1 or tier 2 support for 32-bit Apple targets. That announcement did not expect a patch release. 1.41.1 also includes release binaries for these targets.
You can now use the slice pattern syntax with subslices. e.g.
fn foo(words: &[&str]) { match words { ["Hello", "World", "!", ..] => println!("Hello World!"), ["Foo", "Bar", ..] => println!("Baz"), rest => println!("{:?}", rest), } }
You can now use #[repr(transparent)] on univariant enums. Meaning that you can create an enum that has the exact layout and ABI of the type it contains.
You can now use outer attribute procedural macros on inline modules.
There are some syntax-only changes:
default is syntactically allowed before items in trait definitions.
Items in impls (i.e. consts, types, and fns) may syntactically leave out their bodies in favor of ;.
Bounds on associated types in impls are now syntactically allowed (e.g. type Foo: Ord;).
... (the C-variadic type) may occur syntactically directly as the type of any function parameter.
These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by procedural macros and conditional compilation.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Error::description has been deprecated, and its use will now produce a warning. It's recommended to use Display/to_string instead.
Fixed using binary operations with &{number} (e.g. &1.0) not having the type inferred correctly.
Attributes such as #[cfg()] can now be used on if expressions.
Syntax only changes
item macro fragments can be interpolated into traits, impls, and extern blocks. For example, you may now write:
macro_rules! mac_trait { ($i:item) => { trait T { $i } } } mac_trait! { fn foo() {} }
These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.
You can now pass multiple lint flags to rustc to override the previous flags. For example; rustc -D unused -A unused-variables denies everything in the unused lint group except unused-variables which is explicitly allowed. However, passing rustc -A unused-variables -D unused denies everything in the unused lint group including unused-variables since the allow flag is specified before the deny flag (and therefore overridden).
Arc<[T; N]>, Box<[T; N]>, and Rc<[T; N]>, now implement
TryFrom<Arc<[T]>>,TryFrom<Box<[T]>>, and TryFrom
You can now use associated constants on floats and integers directly, rather than having to import the module. e.g. You can now write u32::MAX or f32::NAN with no imports.
Added the primitive module to std and core. This module reexports Rust's primitive types. This is mainly useful in macros where you want avoid these types being shadowed.
You can now set config [profile]s in your .cargo/config, or through your environment.
Cargo will now set CARGO_BIN_EXE_
Certain checks in the const_err lint were deemed unrelated to const evaluation, and have been moved to the unconditional_panic and arithmetic_overflow lints.
Having trailing syntax in the assert! macro is now a hard error. This has been a warning since 1.36.0.
Fixed Self not having the correctly inferred type. This incorrectly led to some instances being accepted, and now correctly emits a hard error.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Syntax-only changes
#[cfg(FALSE)] mod foo { mod bar { mod baz; // `foo/bar/baz.rs` doesn't exist, but no error! } }
These are still rejected semantically, so you will likely receive an error but these changes can be seen and parsed by macros and conditional compilation.
Rustc now respects the -C codegen-units flag in incremental mode. Additionally when in incremental mode rustc defaults to 256 codegen units.
Refactored catch_unwind to have zero-cost, unless unwinding is enabled and a panic is thrown.
Added tier 3* support for the aarch64-unknown-none and aarch64-unknown-none-softfloat targets.
Added tier 3 support for arm64-apple-tvos and x86_64-apple-tvos targets.
Special cased vec![] to map directly to Vec::new(). This allows vec![] to be able to be used in const contexts.
OsString now implements DerefMut and IndexMut returning a &mut OsStr.
Vec
Added the cargo tree command which will print a tree graph of your dependencies. E.g.
mdbook v0.3.2 (/Users/src/rust/mdbook) ├── ammonia v3.0.0 │ ├── html5ever v0.24.0 │ │ ├── log v0.4.8 │ │ │ └── cfg-if v0.1.9 │ │ ├── mac v0.1.1 │ │ └── markup5ever v0.9.0 │ │ ├── log v0.4.8 (*) │ │ ├── phf v0.7.24 │ │ │ └── phf_shared v0.7.24 │ │ │ ├── siphasher v0.2.3 │ │ │ └── unicase v1.4.2 │ │ │ [build-dependencies] │ │ │ └── version_check v0.1.5 ...
You can also display dependencies on multiple versions of the same crate with cargo tree -d (short for cargo tree --duplicates).
The file_name property in JSON output of macro errors now points the actual
source file rather than the previous format of
The minimum required external LLVM version has been bumped to LLVM 8.
mem::{zeroed, uninitialised} will now panic when used with types that do not allow zero initialization such as NonZeroU8. This was previously a warning.
In 1.45.0 (the next release) converting a f64 to u32 using the as operator has been defined as a saturating operation. This was previously undefined behaviour, but you can use the {f64, f32}::to_int_unchecked methods to continue using the current behaviour, which may be desirable in rare performance sensitive situations.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Out of range float to int conversions using as has been defined as a saturating conversion. This was previously undefined behaviour, but you can use the {f64, f32}::to_int_unchecked methods to continue using the current behaviour, which may be desirable in rare performance sensitive situations.
mem::Discriminant
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.
You can now override individual target features through the target-feature flag. E.g. -C target-feature=+avx2 -C target-feature=+fma is now equivalent to -C target-feature=+avx2,+fma.
Added the force-unwind-tables flag. This option allows rustc to always generate unwind tables regardless of panic strategy.
Added the embed-bitcode flag. This codegen flag allows rustc to include LLVM bitcode into generated rlibs (this is on by default).
Added tier 3 support for the thumbv7a-uwp-windows-msvc target.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
net::{SocketAddr, SocketAddrV4, SocketAddrV6} now implements PartialOrd and Ord.
You can now use char with ops::{Range, RangeFrom, RangeFull, RangeInclusive, RangeTo} to iterate over a range of codepoints. E.g. you can now write the following;
for ch in 'a'..='z' { print!("{}", ch); } println!(); // Prints "abcdefghijklmnopqrstuvwxyz"
BitOr and BitOrAssign are implemented for all NonZero integer types.
The fetch_min, and fetch_max methods have been added to all atomic integer types.
The fetch_update method has been added to all atomic integer types.
Rustdoc now supports strikethrough text in Markdown. E.g. ~~outdated information~~ becomes "outdated information".
{f32, f64}::powi now returns a slightly different value on Windows. This is due to changes in LLVM's intrinsics which {f32, f64}::powi uses.
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 lto flag is incompatible with the new embed-bitcode=no.
This may cause issues if LTO is enabled through RUSTFLAGS or cargo rustc
flags while cargo is adding embed-bitcode itself. The recommended way to
control LTO is with Cargo profiles, either in Cargo.toml or .cargo/config,
or by setting CARGO_PROFILE_
if, match, and loop expressions can now be used in const functions.
Additionally you are now also able to coerce and cast to slices (&[T]) in const functions.
Recursively indexing into tuples no longer needs parentheses. E.g. x.0.0 over (x.0).0.
mem::transmute can now be used in statics and constants. Note You currently can't use mem::transmute in constant functions.
Added a number of new environment variables that are now available when compiling your crate.
CARGO_BIN_NAME and CARGO_CRATE_NAME Providing the name of the specific binary being compiled and the name of the crate.
CARGO_PKG_LICENSE The license from the manifest of the package.
CARGO_PKG_LICENSE_FILE The path to the license file.
The target configuration option abi_blacklist has been renamed to unsupported_abis. The old name will still continue to work.
Rustc will now warn if you cast a C-like enum that implements Drop. This was previously accepted but will become a hard error in a future release.
Rustc will fail to compile if you have a struct with #[repr(i128)] or #[repr(u128)]. This representation is currently only allowed on enums.
Tokens passed to macro_rules! are now always captured. This helps ensure that spans have the correct information, and may cause breakage if you were relying on receiving spans with dummy information.
The InnoSetup installer for Windows is no longer available. This was a legacy installer that was replaced by a MSI installer a few years ago but was still being built.
{f32, f64}::asinh now returns the correct values for negative numbers.
Rustc now correctly relates the lifetime of an existential associated type. This fixes some edge cases where rustc would erroneously allow you to pass a shorter lifetime than expected.
Rustc now dynamically links to libz (also called zlib) on Linux. The library will need to be installed for rustc to work, even though we expect it to be already available on most systems.
Tests annotated with #[should_panic] are broken on ARMv7 while running under QEMU.
Pretty printing of some tokens in procedural macros changed. The exact output returned by rustc's pretty printing is an unstable implementation detail: we recommend any macro relying on it to switch to a more robust parsing system.
Stabilized the -C control-flow-guard codegen option, which enables Control Flow Guard for Windows platforms, and is ignored on other platforms.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The following previously stable APIs have now been made const.
build-dependencies are now built with opt-level 0 by default. You can override this by setting the following in your Cargo.toml.
[profile.release.build-override] opt-level = 3
cargo-help will now display man pages for commands rather just the --help text.
cargo-metadata now emits a test field indicating if a target has tests enabled.
Added changes to how proc-macros are expanded in macro_rules! that should help to preserve more span information. These changes may cause compilation errors if your macro was unhygenic or didn't correctly handle Delimiter::None.
linux-gnu targets now require minimum kernel 2.6.32 and glibc 2.11.
Added the rustc-docs component. This allows you to install and read the documentation for the compiler internal APIs. (Currently only available for x86_64-unknown-linux-gnu.)
Improved default settings for bootstrapping in x.py. You can read details about this change in the "Changes to x.py defaults" post on the Inside Rust blog.
The unsafe keyword is now syntactically permitted on modules. This is still rejected semantically, but can now be parsed by procedural macros.
Stabilised the -C link-self-contained=
You can now use -C target-feature=+crt-static on linux-gnu targets. Note: If you're using cargo you must explicitly pass the --target flag.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The following previously stable methods are now const fn's:
You can now link to items in rustdoc using the intra-doc link syntax. E.g. /// Uses [`std::future`] will automatically generate a link to std::future's documentation. See "Linking to items by name" for more information.
Promotion of references to 'static lifetime inside const fn now follows the same rules as inside a fn body. In particular, &foo() will not be promoted to 'static lifetime any more inside const fns.
Fixed recursive nonterminals not being expanded in macros during pretty-print/reparse check. This may cause errors if your macro wasn't correctly handling recursive nonterminal tokens.
&mut references to non zero-sized types are no longer promoted.
#[target_feature] will now error if used in a place where it has no effect.
Foreign exceptions are now caught by catch_unwind and will cause an abort. Note: This behaviour is not guaranteed and is still considered undefined behaviour, see the catch_unwind documentation for further information.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Building rustc from source now uses ninja by default over make. You can continue building with make by setting ninja=false in your config.toml.
Unions can now implement Drop, and you can now have a field in a union
with ManuallyDrop
You can now bind by reference and by move in patterns. This allows you to selectively borrow individual components of a type. E.g.
#[derive(Debug)] struct Person { name: String, age: u8, } let person = Person { name: String::from("Alice"), age: 20, }; // `name` is moved out of person, but `age` is referenced. let Person { name, ref age } = person; println!("{} {}", name, age);
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The following previously stable methods are now const.
Building a crate with cargo-package should now be independently reproducible.
Added CARGO_PRIMARY_PACKAGE build-time environment variable. This variable will be set if the crate being built is one the user selected to build, either with -p or through defaults.
You can now use glob patterns when specifying packages & targets.
Demoted i686-unknown-freebsd from host tier 2 to target tier 2 support.
Macros that end with a semi-colon are now treated as statements even if they expand to nothing.
Rustc will now check for the validity of some built-in attributes on enum variants. Previously such invalid or unused attributes could be ignored.
Leading whitespace is stripped more uniformly in documentation comments, which may change behavior. You read this post about the changes for more details.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
You can now use const values for x in [x; N] array expressions. This has been technically possible since 1.38.0, as it was unintentionally stabilized.
Assignments to ManuallyDrop
Added tier 3* support for the armv5te-unknown-linux-uclibceabi target.
Added tier 3 support for the aarch64-apple-ios-macabi target.
The x86_64-unknown-freebsd is now built with the full toolset.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
ops::{Index, IndexMut} are now implemented for fixed sized arrays of any length.
On Unix platforms, the std::fs::File type now has a "niche" of -1.
This value cannot be a valid file descriptor, and now means Option
The following previously stable methods are now const.
pow for all integer types.
checked_pow for all integer types.
saturating_pow for all integer types.
wrapping_pow for all integer types.
next_power_of_two for all unsigned integer types.
checked_next_power_of_two for all unsigned integer types.
Added the [build.rustc-workspace-wrapper] option. This option sets a wrapper to execute instead of rustc, for workspace members only.
The compare_and_swap method on atomics has been deprecated. It's recommended to use the compare_exchange and compare_exchange_weak methods instead.
Overriding a forbid lint at the same level that it was set is now a hard error.
You can no longer intercept panic! calls by supplying your own macro. It's recommended to use the #[panic_handler] attribute to provide your own implementation.
Semi-colons after item statements (e.g. struct Foo {};) now produce a warning.
You can now parameterize items such as functions, traits, and structs by constant values in addition to by types and lifetimes. Also known as "const generics" E.g. you can now write the following. Note: Only values of primitive integers, bool, or char types are currently permitted.
struct GenericArray{ inner: [T; LENGTH] } impl GenericArray { const fn last(&self) -> Option<&T> { if LENGTH == 0 { None } else { Some(&self.inner[LENGTH - 1]) } } }
Added the -Csplit-debuginfo codegen option for macOS platforms. This option controls whether debug information is split across multiple files or packed into a single file. Note This option is unstable on other platforms.
Added tier 3 support for i386-unknown-linux-gnu and i486-unknown-linux-gnu targets.
The target-cpu=native option will now detect individual features of CPUs.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Box::downcast is now also implemented for any dyn Any + Send + Sync object.
unsigned_abs is now implemented for all signed integer types.
rc::Weak
Div and Rem by their NonZero variant is now implemented for all unsigned integers.
Added the split-debuginfo profile option to control the -Csplit-debuginfo codegen option.
Added the resolver field to Cargo.toml to enable the new feature resolver and CLI option behavior. Version 2 of the feature resolver will try to avoid unifying features of dependencies where that unification could be unwanted. Such as using the same dependency with a std feature in a build scripts and proc-macros, while using the no-std feature in the final binary. See the Cargo book documentation for more information on the feature.
Rustdoc will now include documentation for methods available from nested Deref traits.
You can now provide a --default-theme flag which sets the default theme to use for documentation.
Various improvements to intra-doc links:
WASI platforms no longer use the wasm-bindgen ABI, and instead use the wasm32 ABI.
rustc no longer promotes division, modulo and indexing operations to const that could fail.
armv5te-unknown-linux-gnueabi
sparc64-unknown-linux-gnu
thumbv7neon-unknown-linux-gnueabihf
armv7-unknown-linux-gnueabi
x86_64-unknown-linux-gnux32
atomic::spin_loop_hint has been deprecated. It's recommended to use hint::spin_loop instead.
Added the unsafe_op_in_unsafe_fn lint, which checks whether the unsafe code in an unsafe fn is wrapped in a unsafe block. This lint is allowed by default, and may become a warning or hard error in a future edition.
You can now cast mutable references to arrays to a pointer of the same type as the element.
Added tier 3* support for the following targets.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The following previously stable APIs are now const.
Rustdoc lints are now treated as a tool lint, meaning that lints are now prefixed with rustdoc:: (e.g. #[warn(rustdoc::broken_intra_doc_links)]). Using the old style is still allowed, and will become a warning in a future release.
You can now use "task lists" in Rustdoc Markdown. E.g.
- [x] Complete - [ ] Todo
You can now pass multiple filters to tests. E.g. cargo test -- foo bar will run all tests that match foo and bar.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
This release disables incremental compilation, unless the user has explicitly opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable.
This is due to the widespread, and frequently occurring, breakage encountered by Rust users due to newly enabled incremental verification in 1.52.0. Notably, Rust users should upgrade to 1.52.0 or 1.52.1: the bugs that are detected by newly added incremental verification are still present in past stable versions, and are not yet fixed on any channel. These bugs can lead to miscompilation of Rust binaries.
These problems only affect incremental builds, so release builds with Cargo should not be affected unless the user has explicitly opted into incremental. Debug and check builds are affected.
See 84970 for more details.
You can now use unicode for identifiers. This allows multilingual identifiers but still doesn't allow glyphs that are not considered characters such as ◆ or 🦀. More specifically you can now use any identifier that matches the UAX #31 "Unicode Identifier and Pattern Syntax" standard. This is the same standard as languages like Python, however Rust uses NFC normalization which may be different from other languages.
You can now specify "or patterns" inside pattern matches. Previously you could only use | (OR) on complete patterns. E.g.
let x = Some(2u8); // Before matches!(x, Some(1) | Some(2)); // Now matches!(x, Some(1 | 2));
Added the :pat_param macro_rules! matcher. This matcher has the same semantics as the :pat matcher. This is to allow :pat to change semantics to being a pattern fragment in a future edition.
Added Tier 3* support for the wasm64-unknown-unknown target.
Improved debuginfo for closures and async functions on Windows MSVC.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Abort messages will now forward to android_set_abort_message on Android platforms when available.
Arrays of any length now implement IntoIterator. Currently calling .into_iter() as a method on an array will return impl Iterator<Item=&T>, but this may change in a future edition to change Item to T. Calling IntoIterator::into_iter directly on arrays will provide impl Iterator<Item=T> as expected.
leading_zeros, and trailing_zeros are now available on all NonZero integer types.
{f32, f64}::from_str now parse and print special values (NaN, -0) according to IEEE 754.
You can now index into slices using (Bound<usize>, Bound<usize>).
Cargo now supports git repositories where the default HEAD branch is not "master". This also includes a switch to the version 3 Cargo.lock format which can handle default branches correctly.
The authors field is no longer included in Cargo.toml for new projects.
Implement token-based handling of attributes during expansion
Ipv4::from_str will now reject octal format IP addresses in addition to rejecting hexadecimal IP addresses. The octal format can lead to confusion and potential security vulnerabilities and is no longer recommended.
The added BITS constant may conflict with external definitions. In particular, this was known to be a problem in the lexical-core crate, but they have published fixes for semantic versions 0.4 through 0.7. To update this dependency alone, use cargo update -p lexical-core.
Incremental compilation remains off by default, unless one uses the RUSTC_FORCE_INCREMENTAL=1 environment variable added in 1.52.1.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
You can now use macros for values in some built-in attributes. This primarily allows you to call macros within the #[doc] attribute. For example, to include external documentation in your crate, you can now write the following:
#![doc = include_str!("README.md")]
You can now cast between unsized slice types (and types which contain unsized slices) in const fn.
You can now use multiple generic lifetimes with impl Trait where the lifetimes don't explicitly outlive another. In code this means that you can now have impl Trait<'a, 'b> where as before you could only have impl Trait<'a, 'b> where 'b: 'a.
Rustc will now search for custom JSON targets in
/lib/rustlib/
You can now use #[target_feature] on safe functions when targeting WebAssembly platforms.
Improved debugger output for enums on Windows MSVC platforms.
Added tier 3* support for bpfel-unknown-none and bpfeb-unknown-none.
-Zmutable-noalias=yes is enabled by default when using LLVM 12 or above.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
The implementations of vendor intrinsics in core::arch have been significantly refactored. The main user-visible changes are a 50% reduction in the size of libcore.rlib and stricter validation of constant operands passed to intrinsics. The latter is technically a breaking change, but allows Rust to more closely match the C vendor intrinsics API.
Added the --prune <spec> option to cargo-tree to remove a package from the dependency graph.
Added the --depth option to cargo-tree to print only to a certain depth in the tree
Added the no-proc-macro value to cargo-tree --edges to hide procedural macro dependencies.
A new environment variable named CARGO_TARGET_TMPDIR is available. This variable points to a directory that integration tests and benches can use as a "scratchpad" for testing filesystem operations.
Mixing Option and Result via ? is no longer permitted in closures for inferred types.
As previously mentioned the std::arch intrinsics now uses stricter const checking than before and may reject some previously accepted code.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Updated std's float parsing to use the Eisel-Lemire algorithm. These improvements should in general provide faster string parsing of floats, no longer reject certain valid floating point values, and reduce the produced code size for non-stripped artifacts.
The following previously stable functions are now const.
The "Implementors" section on traits no longer shows redundant method definitions.
Trait implementations are toggled open by default. This should make the implementations more searchable by tools like CTRL+F in your browser.
Intra-doc links should now correctly resolve associated items (e.g. methods) through type aliases.
std functions that return an io::Error will no longer use the ErrorKind::Other variant. This is to better reflect that these kinds of errors could be categorised into newer more specific ErrorKind variants, and that they do not represent a user error.
Using environment variable names with process::Command on Windows now behaves as expected. Previously using environment variables with Command would cause them to be ASCII-uppercased.
Rustdoc will now warn on using rustdoc lints that aren't prefixed with rustdoc::
RUSTFLAGS is no longer set for build scripts. Build scripts should use CARGO_ENCODED_RUSTFLAGS instead. See the documentation for more details.
Support memory, address, and thread sanitizers on aarch64-unknown-freebsd.
Allow specifying a deployment target version for all iOS targets
Warnings can be forced on with --force-warn. This feature is primarily intended for usage by cargo fix, rather than end users.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Allow writing of incomplete UTF-8 sequences via stdout/stderr on Windows. The Windows console still requires valid Unicode, but this change allows splitting a UTF-8 character across multiple write calls. This allows, for instance, programs that just read and write data buffers (e.g. copying a file to stdout) without regard for Unicode or character boundaries.
Prefer AtomicU{64,128} over Mutex for Instant backsliding protection. For this use case, atomics scale much better under contention.
impl Default, Copy, Clone for std::io::Sink and std::io::Empty
Treat invalid environment variable names as nonexistent. Previously, the environment functions would panic if given a variable name with an internal null character or equal sign (=). Now, these functions will just treat such names as nonexistent variables, since the OS cannot represent the existence of a variable with such a name.
core::panic::{UnwindSafe, RefUnwindSafe, AssertUnwindSafe} These APIs were previously stable in std, but are now also available in core.
These APIs are now usable in const contexts:
Cargo supports specifying a minimum supported Rust version in Cargo.toml. This has no effect at present on dependency version selection. We encourage crates to specify their minimum supported Rust version, and we encourage CI systems that support Rust code to include a crate's specified minimum version in the test matrix for that crate by default.
Update to new argument parsing rules on Windows. This adjusts Rust's standard library to match the behavior of the standard libraries for C/C++. The rules have changed slightly over time, and this PR brings us to the latest set of rules (changed in 2008).
Disallow the aapcs calling convention on aarch64 This was already not supported by LLVM; this change surfaces this lack of support with a better error message.
Calls to libc::getpid / std::process::id from Command::pre_exec may return different values on glibc <= 2.24. Rust now invokes the clone3 system call directly, when available, to use new functionality available via that system call. Older versions of glibc cache the result of getpid, and only update that cache when calling glibc's clone/fork functions, so a direct system call bypasses that cache update. glibc 2.25 and newer no longer cache getpid for exactly this reason.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
LLVM is compiled with PGO in published x86_64-unknown-linux-gnu artifacts. This improves the performance of most Rust builds.
Unify representation of macros in internal data structures. This change fixes a host of bugs with the handling of macros by the compiler, as well as rustdoc.
New lints to detect the presence of bidirectional-override Unicode codepoints in the compiled source code (CVE-2021-42574)
Add SOLID targets at Tier 3*: aarch64-kmc-solid_asp3, armv7a-kmc-solid_asp3-eabi, armv7a-kmc-solid_asp3-eabihf
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Many more functions are marked #[must_use], producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
These APIs are now usable in const contexts:
Ignore derived Clone and Debug implementations during dead code analysis. This will break some builds that set #![deny(dead_code)].
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Format strings can now capture arguments simply by writing {ident} in the string. This works in all macros accepting format strings. Support for this in panic! (panic!("{ident}")) requires the 2021 edition; panic invocations in previous editions that appear to be trying to use this will result in a warning lint about not having the intended effect.
*const T pointers can now be dereferenced in const contexts.
The rules for when a generic struct implements Unsize have been relaxed.
Stabilize -Z strip as -C strip. Note that while release builds already don't add debug symbols for the code you compile, the compiled standard library that ships with Rust includes debug symbols, so you may want to use the strip option to remove these symbols to produce smaller release binaries. Note that this release only includes support in rustc, not directly in cargo.
Add support for LLVM coverage mapping format versions 5 and 6
Build musl dist artifacts with debuginfo enabled. When building release binaries using musl, you may want to use the newly stabilized strip option to remove these debug symbols, reducing the size of your binaries.
Error messages point at the source of trait bound obligations in more places
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
All remaining functions in the standard library have #[must_use] annotations where appropriate, producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
Paths are automatically canonicalized on Windows for operations that support it
Implement Termination for Result<Infallible, E>. This allows writing fn main() -> Result<Infallible, ErrorType>, for a program whose successful exits never involve returning from main (for instance, a program that calls exit, or that uses exec to run another program).
These APIs are now usable in const contexts:
Try all stable method candidates first before trying unstable ones. This change ensures that adding new nightly-only methods to the Rust standard library will not break code invoking methods of the same name from traits outside the standard library.
Windows: std::process::Command will no longer search the current directory for executables.
All proc-macro backward-compatibility lints are now deny-by-default.
proc_macro: Append .0 to unsuffixed float if it would otherwise become int token
Refactor weak symbols in std::sys::unix. This optimizes accesses to glibc functions, by avoiding the use of dlopen. This does not increase the minimum expected version of glibc. However, software distributions that use symbol versions to detect library dependencies, and which take weak symbols into account in that analysis, may detect rust binaries as requiring newer versions of glibc.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Stabilize new symbol mangling format, leaving it opt-in (-Csymbol-mangling-version=v0)
Warn when a #[test]-like built-in attribute macro is present multiple times.
This release disables incremental compilation, unless the user has explicitly opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable. This is due to a known and relatively frequently occurring bug in incremental compilation, which causes builds to issue internal compiler errors. This particular bug is already fixed on nightly, but that fix has not yet rolled out to stable and is deemed too risky for a direct stable backport.
As always, we encourage users to test with nightly and report bugs so that we can track failures and fix issues earlier.
See 94124 for more details.
char::TryFromCharError implementing Clone, Debug, Display, PartialEq, Copy, Eq, Error
Const-stable:
Refactor weak symbols in std::sys::unix This may add new, versioned, symbols when building with a newer glibc, as the standard library uses weak linkage rather than dynamically attempting to load certain symbols at runtime.
Deprecate crate_type and crate_name nested inside #![cfg_attr] This adds a future compatibility lint to supporting the use of cfg_attr wrapping either crate_type or crate_name specification within Rust files; it is recommended that users migrate to setting the equivalent command line flags.
Remove effect of #[no_link] attribute on name resolution This may expose new names, leading to conflicts with preexisting names in a given namespace and a compilation failure.
Weaken guarantee around advancing underlying iterators in zip
Make split_inclusive() on an empty slice yield an empty output
Update std::env::temp_dir to use GetTempPath2 on Windows when available.
unreachable! was updated to match other formatting macro behavior on Rust 2021
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Enable combining +crt-static and relocation-model=pic on x86_64-unknown-linux-gnu
Fixes wrong unreachable_pub lints on nested and glob public reexport
Add new Tier 3 target armv7-unknown-linux-uclibceabi (softfloat)*
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Mitigations for platforms with non-monotonic clocks have been removed from Instant::now. On platforms that don't provide monotonic clocks, an instant is not guaranteed to be greater than an earlier instant anymore.
Instant::{duration_since, elapsed, sub} do not panic anymore on underflow, saturating to 0 instead. In the real world the panic happened mostly on platforms with buggy monotonic clock implementations rather than catching programming errors like reversing the start and end times. Such programming errors will now results in 0 rather than a panic.
In a future release we're planning to increase the baseline requirements for the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love your feedback in PR #95026.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
The #[target_feature] attribute can now be used with aarch64 features
Consistently show absent stdio handles on Windows as NULL handles
Make std::io::stdio::lock() return 'static handles. Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing let out = std::io::stdout().lock(); because out would outlive the return value of stdout(). Such code now works, eliminating a common pitfall that affected many Rust users.
Vec::from_raw_parts is now less restrictive about its inputs
std::thread::available_parallelism now takes cgroup quotas into account. Since available_parallelism is often used to create a thread pool for parallel computation, which may be CPU-bound for performance, available_parallelism will return a value consistent with the ability to use that many threads continuously, if possible. For instance, in a container with 8 virtual CPUs but quotas only allowing for 50% usage, available_parallelism will return 4.
std::process::ExitCode and std::process::Termination. The stabilization of these two APIs now makes it possible for programs to return errors from main with custom exit codes.
These APIs are now usable in const contexts:
No feature changes, but see compatibility notes.
Previously native static libraries were linked as whole-archive in some cases, but now rustc tries not to use whole-archive unless explicitly requested. This change may result in linking errors in some cases. To fix such errors, native libraries linked from the command line, build scripts, or #[link] attributes need to
(more common) either be reordered to respect dependencies between them (if a depends on b then a should go first and b second)
(less common) or be updated to use the +whole-archive modifier.
The number of # in r# raw string literals is now required to be less than 256
When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced
cargo vendor now only accepts one value for each --sync flag
cfg predicates in all() and any() are always evaluated to detect errors, instead of short-circuiting. The compatibility considerations here arise in nightly-only code that used the short-circuiting behavior of all to write something like cfg(all(feature = "nightly", syntax-requiring-nightly)), which will now fail to compile. Instead, use either cfg_attr(feature = "nightly", ...) or nested uses of cfg.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Stabilize #[derive(Default)] on enums with a #[default] variant
Teach flow sensitive checks that visibly uninhabited call expressions never return
Fix constants not getting dropped if part of a diverging expression
Support unit struct/enum variant in destructuring assignment
Remove mutable_borrow_reservation_conflict lint and allow the code pattern
Make unaligned_references lint deny-by-default This lint is also a future compatibility lint, and is expected to eventually become a hard error.
Only add codegen backend to dep info if -Zbinary-dep-depinfo is used
Add tier 3 aarch64-pc-windows-gnullvm and x86_64-pc-windows-gnullvm targets*
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
Added the cargo add command for adding dependencies to Cargo.toml from the command-line. docs
Package ID specs now support name@version syntax in addition to the previous name:version to align with the behavior in cargo add and other tools. cargo install and cargo yank also now support this syntax so the version does not need to passed as a separate flag.
The git and registry directories in Cargo's home directory (usually ~/.cargo) are now marked as cache directories so that they are not included in backups or content indexing (on Windows).
Added automatic @ argfile support, which will use "response files" if the command-line to rustc exceeds the operating system's limit.
cargo test now passes --target to rustdoc if the specified target is the same as the host target. #10594
rustdoc: doctests are now run on unexported macro_rules! macros, matching other private items
Enforce Copy bounds for repeat elements while considering lifetimes
Windows: Fix potential unsoundness by aborting if File reads or writes cannot complete synchronously.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Rust 1.62.1 addresses a few recent regressions in the compiler and standard library, and also mitigates a CPU vulnerability on Intel SGX.
The compiler fixed unsound function coercions involving impl Trait return types.
The compiler fixed an incremental compilation bug with async fn lifetimes.
Windows added a fallback for overlapped I/O in synchronous reads and writes.
The x86_64-fortanix-unknown-sgx target added a mitigation for the MMIO stale data vulnerability, advisory INTEL-SA-00615.
Stabilize the bundle native library modifier, also removing the deprecated static-nobundle linking kind.
* Refer to Rust's platform support page for more information on Rust's tiered platform support.
These APIs are now usable in const contexts:
#[link] attributes are now checked more strictly, which may introduce errors for invalid attribute arguments that were previously ignored.
Rounding is now used when converting a float to a Duration. The converted duration can differ slightly from what it was.
These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools.
Unions with mutable references or tuples of allowed types are now allowed
It is now considered valid to deallocate memory pointed to by a shared reference &T if every byte in T is inside an UnsafeCell
Unused tuple struct fields are now warned against in an allow-by-default lint, unused_tuple_struct_fields, similar to the existing warning for unused struct fields. This lint will become warn-by-default in the future.
Add Nintendo Switch as tier 3 target
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Add the --diagnostic-width compiler flag to define the terminal width.
Add support for link-flavor rust-lld for iOS, tvOS and watchOS
You can now write! or writeln! into an OsString: Implement fmt::Write for OsString
These types were previously stable in std::ffi, but are now also available in core and alloc:
These types were previously stable in std::os::raw, but are now also available in core::ffi and std::ffi:
These APIs are now usable in const contexts:
Packages can now inherit settings from the workspace so that the settings can be centralized in one place. See workspace.package and workspace.dependencies for more details on how to define these common settings.
Cargo commands can now accept multiple --target flags to build for multiple targets at once, and the build.target config option may now take an array of multiple targets.
The --jobs argument can now take a negative number to count backwards from the max CPUs.
Added the --crate-type flag to cargo rustc to override the crate type.
The minimum required versions for all -linux-gnu targets are now at least kernel 3.2 and glibc 2.17, for targets that previously supported older versions: Increase the minimum linux-gnu versions
Network primitives are now implemented with the ideal Rust layout, not the C system layout. This can cause problems when transmuting the types.
A soundness bug in BTreeMap was fixed that allowed data it was borrowing to be dropped before the container.
The Drop behavior of C-like enums cast to ints has changed. These are already discouraged by a compiler warning.
Errors at const-eval time are now in future incompatibility reports
On the thumbv6m-none-eabi target, some incorrect asm! statements were erroneously accepted if they used the high registers (r8 to r14) as an input/output operand. This is no longer accepted.
impl Trait was accidentally accepted as the associated type value of return-position impl Trait, without fulfilling all the trait bounds of that associated type, as long as the hidden type satisfies said bounds. This has been fixed.
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Windows builds now use profile-guided optimization, providing 10-20% improvements to compiler performance: Utilize PGO for windows x64 rustc dist builds
Many improvements to generated code for derives, including performance improvements:
Add lints let_underscore_drop and let_underscore_lock from Clippy
Stabilize breaking from arbitrary labeled blocks ("label-break-value")
Uninitialized integers, floats, and raw pointers are now considered immediate UB. Usage of MaybeUninit is the correct way to work with uninitialized memory.
Stabilize raw-dylib for Windows x86_64, aarch64, and thumbv7a
Use niche-filling optimization even when multiple variants have data
Add support for generating unique profraw files by default when using -C instrument-coverage
New targets:
Add powerpc64-unknown-openbsd and riscv64-unknown-openbsd as tier 3 targets
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Document no support for writing to non-blocking stdio/stderr
std::layout::Layout size must not overflow isize::MAX when rounded up to align This also changes the safety conditions on Layout::from_size_align_unchecked.
These APIs are now stable in const contexts:
Take priority into account within the pending queue. This slightly optimizes job scheduling by Cargo, with typically small improvements on larger crate graph builds.
std::layout::Layout size must not overflow isize::MAX when rounded up to align. This also changes the safety conditions on Layout::from_size_align_unchecked.
PollFn now only implements Unpin if the closure is Unpin. This is a possible breaking change if users were relying on the blanket unpin implementation. See discussion on the PR for details of why this change was made.
Drop ExactSizeIterator impl from std::char::EscapeAscii This is a backwards-incompatible change to the standard library's surface area, but is unlikely to affect real world usage.
Do not consider a single repeated lifetime eligible for elision in the return type This behavior was unintentionally changed in 1.64.0, and this release reverts that change by making this an error again.
Reenable disabled early syntax gates as future-incompatibility lints
Deny usage of #![cfg_attr(..., crate_type = ...)] to set the crate type This strengthens the forward compatibility lint deprecated_cfg_attr_crate_type_name to deny.
llvm-has-rust-patches allows setting the build system to treat the LLVM as having Rust-specific patches This option may need to be set for distributions that are building Rust with a patched LLVM via llvm-config, not the built-in LLVM.
Combining three or more languages (e.g. Objective C, C++ and Rust) into one binary may hit linker limitations when using lld. For more information, see issue 102754.
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Enable MIR inlining for optimized compilations This provides a 3-10% improvement in compiletimes for real world crates. See perf results.
Permit specifying explicit discriminants on all repr(Int) enums
#[repr(u8)] enum Foo { A(u8) = 0, B(i8) = 1, C(bool) = 42, }
Allow transmutes between the same type differing only in lifetimes
Change constant evaluation errors from a deny-by-default lint to a hard error
Trigger must_use on impl Trait for supertraits This makes impl ExactSizeIterator respect the existing #[must_use] annotation on Iterator.
Opaque types no longer imply lifetime bounds This is a soundness fix which may break code that was erroneously relying on this behavior.
Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets
Refer to Rust's platform support page for more information on Rust's tiered platform support.
uX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}
iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}
iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}
BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}
See detailed release notes for more.
Only apply ProceduralMasquerade hack to older versions of rental
Update libstd's libc to 0.2.135 (to make libstd no longer pull in libiconv.dylib on Darwin)
Opaque types no longer imply lifetime bounds This is a soundness fix which may break code that was erroneously relying on this behavior.
Make order_dependent_trait_objects show up in future-breakage reports
Change std::process::Command spawning to default to inheriting the parent's signal mask
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Added validation of SSH host keys for git URLs in Cargo (CVE-2022-46176)
Enable varargs support for calling conventions other than C or cdecl.
Add new MIR constant propagation based on dataflow analysis.
Optimize field ordering by grouping m*2^n-sized fields with equivalently aligned ones.
Added, updated, and removed targets:
Add a tier 3 target for PowerPC on AIX, powerpc64-ibm-aix.
Add a tier 3 target for the Sony PlayStation 1, mipsel-sony-psx.
Add tier 3 no_std targets for the QNX Neutrino RTOS, aarch64-unknown-nto-qnx710 and x86_64-pc-nto-qnx710.
Promote UEFI targets to tier 2, aarch64-unknown-uefi, i686-unknown-uefi, and x86_64-unknown-uefi.
Remove tier 3 linuxkernel targets (not used by the actual kernel).
Refer to Rust's platform support page for more information on Rust's tiered platform support.
These APIs are now stable in const contexts:
The layout of repr(Rust) types now groups m*2^n-sized fields with equivalently aligned ones. This is intended to be an optimization, but it is also known to increase type sizes in a few cases for the placement of enum tags. As a reminder, the layout of repr(Rust) types is an implementation detail, subject to change.
0.5 now rounds to 0 when formatted to 0 decimal places. This makes it consistent with the rest of floating point formatting that rounds ties toward even digits.
Chains of && and || will now drop temporaries from their sub-expressions in evaluation order, left-to-right. Previously, it was "twisted" such that the first expression dropped its temporaries last, after all of the other expressions dropped in order.
Underscore suffixes on string literals are now a hard error. This has been a future-compatibility warning since 1.20.0.
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Stabilize default_alloc_error_handler This allows usage of alloc on stable without requiring the definition of a handler for allocation failure. Defining custom handlers is still unstable.
These APIs are now stable in const contexts:
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Fix miscompilation in produced Windows MSVC artifacts This was introduced by enabling ThinLTO for the distributed rustc which led to miscompilations in the resulting binary. Currently this is believed to be limited to the -Zdylib-lto flag used for rustc compilation, rather than a general bug in ThinLTO, so only rustc artifacts should be affected.
Update the GitHub RSA host key bundled within Cargo. The key was rotated by GitHub on 2023-03-24 after the old one leaked.
Mark the old GitHub RSA host key as revoked. This will prevent Cargo from accepting the leaked key even when trusted by the system.
These APIs are now stable in const contexts:
The rust-analysis component from rustup now only contains a warning placeholder. This was primarily intended for RLS, and the corresponding -Zsave-analysis flag has been removed from the compiler as well.
Unaligned references to packed fields are now a hard error. This has been a warning since 1.53, and denied by default with a future-compatibility warning since 1.62.
Cargo now emits errors on invalid characters in a registry token.
The Rust distribution no longer always includes rustdoc If tools = [...] is set in config.toml, we will respect a missing rustdoc in that list. By default rustdoc remains included. To retain the prior behavior explicitly add "rustdoc" to the list.
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.