Rust is een programmeertaal bedacht door Graydon Hoare en oorspronkelijk ontwikkeld door Mozilla. Het is deels geïnspireerd op de programmeertaal C, maar kent syntactische en semantische verschillen. Het focust op veiligheid en beoogt moderne computersystemen efficiënter te benutten. Het wordt ingezet door onder andere Cloudflare, OVH, Mozilla, Deliveroo, Coursera, AppSignal en Threema. Versie 1.71.0 is begin deze maand uitgebracht met de volgende aankondiging:
C-unwind ABI1.71.0 stabilizes
C-unwind
(and other-unwind
suffixed ABI variants). The behavior for unforced unwinding (the typical case) is specified in this table from the RFC which proposed this feature. To summarize:Each ABI is mostly equivalent to the same ABI without
-unwind
, except that with-unwind
the behavior is defined to be safe when an unwinding operation (panic
or C++ style exception) crosses the ABI boundary. Forpanic=unwind
, this is a valid way to let exceptions from one language unwind the stack in another language without terminating the process (as long as the exception is caught in the same language from which it originated); forpanic=abort
, this will typically abort the process immediately.For this initial stabilization, no change is made to the existing ABIs (e.g.
Debugger visualization attributes"C"
), and unwinding across them remains undefined behavior. A future Rust release will amend these ABIs to match the behavior specified in the RFC as the final part in stabilizing this feature (usually aborting at the boundary). Users are encouraged to start using the new unwind ABI variants in their code to remain future proof if they need to unwind across the ABI boundary.1.71.0 stabilizes support for a new attribute,
raw-dylib linking#[debug_visualizer(natvis_file = "...")]
and#[debug_visualizer(gdb_script_file = "...")]
, which allows embedding Natvis descriptions and GDB scripts into Rust libraries to improve debugger output when inspecting data structures created by those libraries. Rust itself has packaged similar scripts for some time for the standard library, but this feature makes it possible for library authors to provide a similar experience to end users. See the reference for details on usage.On Windows platforms, Rust now supports using functions from dynamic libraries without requiring those libraries to be available at build time, using the new
Upgrade to musl 1.2kind="raw-dylib”
option for#[link]
. This avoids requiring users to install those libraries (particularly difficult for cross-compilation), and avoids having to ship stub versions of libraries in crates to link against. This simplifies crates providing bindings to Windows libraries. Rust also supports binding to symbols provided by DLLs by ordinal rather than named symbol, using the new#[link_ordinal]
attribute.As previously announced, Rust 1.71 updates the musl version to 1.2.3. Most users should not be affected by this change.
Const-initialized thread localsRust 1.59.0 stabilized
const
initialized thread local support in the standard library, which allows for more optimal code generation. However, until now this feature was missed in release notes and documentation. Note that this stabilization does not makeconst { ... }
a valid expression or syntax in other contexts; that is a separate and currently unstable feature.Stabilized APIsuse std::cell::Cell; thread_local! { pub static FOO: Cell<u32> = const { Cell::new(1) }; }
CStr::is_empty
BuildHasher::hash_one
NonZeroI*::is_positive
NonZeroI*::is_negative
NonZeroI*::checked_neg
NonZeroI*::overflowing_neg
NonZeroI*::saturating_neg
NonZeroI*::wrapping_neg
Neg for NonZeroI*
Neg for &NonZeroI*
From<[T; N]> for (T...)
(array to N-tuple for N in 1..=12)From<(T...)> for [T; N]
(N-tuple to array for N in 1..=12)windows::io::AsHandle for Box<T>
windows::io::AsHandle for Rc<T>
windows::io::AsHandle for Arc<T>
windows::io::AsSocket for Box<T>
windows::io::AsSocket for Rc<T>
windows::io::AsSocket for Arc<T>
These APIs are now stable in const contexts:
Other changes
<*const T>::read
<*const T>::read_unaligned
<*mut T>::read
<*mut T>::read_unaligned
ptr::read
ptr::read_unaligned
<[T]>::split_at
Check out everything that changed in Rust, Cargo, and Clippy.