doc.rust-lang.org
Cargo: Table and key name consistency Summary • Several table and key names in Cargo.toml have been removed where there were previously two ways to specify the same thing. • Removed [project]; use [package] instead. • Removed default_featur...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Cargo: Rust-version aware resolver Summary • edition = "2024" implies resolver = "3" in Cargo.toml which enables a Rust-version aware dependency resolver. Details Since Rust 1.84.0, Cargo has opt-in support for compatibility with package.ru...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Cargo The following chapters detail changes to Cargo in the 2024 Edition.
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Unsafe functions Summary • The following functions are now marked unsafe: • std::env::set_var • std::env::remove_var • std::os::unix::process::CommandExt::before_exec Details Over time it has become evident that certain functions in the sta...
The Rust Edition Guide
Book
2024-01-01
~2 min read
doc.rust-lang.org
Add IntoIterator for Box<[T]> Summary • Boxed slices implement IntoIterator in all editions. • Calls to IntoIterator::into_iter are hidden in editions prior to 2024 when using method call syntax (i.e., boxed_slice.into_iter()). So, boxed_sl...
The Rust Edition Guide
Book
2024-01-01
~2 min read
doc.rust-lang.org
Changes to the prelude Summary • The Future and IntoFuture traits are now part of the prelude. • This might make calls to trait methods ambiguous which could make some code fail to compile. Details The prelude of the standard library is the...
The Rust Edition Guide
Book
2024-01-01
~2 min read
doc.rust-lang.org
Standard library The following chapters detail changes to the standard library in the 2024 Edition.
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Reserved syntax Summary • Unprefixed guarded strings of the form #"foo"# are reserved for future use. • Two or more # characters are reserved for future use. Details RFC 3593 reserved syntax in the 2024 Edition for guarded string literals t...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
gen keyword Summary • gen is a reserved keyword. Details The gen keyword has been reserved as part of RFC #3513 to introduce "gen blocks" in a future release of Rust. gen blocks will provide a way to make it easier to write certain kinds of...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Missing macro fragment specifiers NOTE: This was originally made a hard error only for the 2024 Edition. In Rust 1.89, released after Rust 2024, the lint was made into a hard error in all editions. Summary • The missing_fragment_specifier l...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Macro Fragment Specifiers Summary • The expr fragment specifier now also supports const and _ expressions. • The expr_2021 fragment specifier has been added for backwards compatibility. Details As new syntax is added to Rust, existing macro...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Never type fallback change Summary • Never type (!) to any type ("never-to-any") coercions fall back to never type (!) rather than to unit type (()). • The never_type_fallback_flowing_into_unsafe lint is now deny by default. Details When th...
The Rust Edition Guide
Book
2024-01-01
~3 min read
doc.rust-lang.org
Disallow references to static mut Summary • The static_mut_refs lint level is now deny by default. This checks for taking a shared or mutable reference to a static mut. Details The static_mut_refs lint detects taking a reference to a static...
The Rust Edition Guide
Book
2024-01-01
~9 min read
doc.rust-lang.org
unsafe_op_in_unsafe_fn warning Summary • The unsafe_op_in_unsafe_fn lint now warns by default. This warning detects calls to unsafe operations in unsafe functions without an explicit unsafe block. Details The unsafe_op_in_unsafe_fn lint wil...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Unsafe attributes Summary • The following attributes must now be marked as unsafe: • export_name • link_section • no_mangle Details Rust 1.82 added the ability in all editions to mark certain attributes as unsafe to indicate that they have...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Unsafe extern blocks Summary • extern blocks must now be marked with the unsafe keyword. Details Rust 1.82 added the ability in all editions to mark extern blocks with the unsafe keyword.[^RFC3484] Adding the unsafe keyword helps to emphasi...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
Match ergonomics reservations Summary • Writing mut, ref, or ref mut on a binding is only allowed within a pattern when the pattern leading up to that binding is fully explicit (i.e. when it does not use match ergonomics). • Put differently...
The Rust Edition Guide
Book
2024-01-01
~4 min read
doc.rust-lang.org
Tail expression temporary scope Summary • Temporary values generated in evaluation of the tail expression of a function or closure body, or a block may now be dropped before local variables, and are sometimes not extended to the next larger...
The Rust Edition Guide
Book
2024-01-01
~3 min read
doc.rust-lang.org
let chains in if and while Summary • Allow chaining of let expressions in the condition operand of if and while. Details Starting with the 2024 Edition, it is now allowed to have chaining of let expressions inside if and while condition ope...
The Rust Edition Guide
Book
2024-01-01
~1 min read
doc.rust-lang.org
if let temporary scope Summary • In an if let $pat = $expr { .. } else { .. } expression, the temporary values generated from evaluating $expr will be dropped before the program enters the else branch instead of after. Details The 2024 Edit...
The Rust Edition Guide
Book
2024-01-01
~3 min read