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 moet moderne computersystemen efficiënter benutten. Het wordt onder meer ingezet door Cloudflare, OVH, Mozilla, Deliveroo, Coursera, AppSignal en Threema. Versie 1.95 is uitgebracht en de releasenotes voor die uitgave kunnen hieronder worden gevonden.
cfg_select!Rust 1.95 introduces a
cfg_select!macro that acts roughly similar to a compile-timematchoncfgs. This fulfills the same purpose as the popularcfg-ifcrate, although with a different syntax.cfg_select!expands to the right-hand side of the first arm whose configuration predicate evaluates totrue. Some examples:if-let guards in matchescfg_select! { unix => { fn foo() { /* unix specific functionality */ } } target_pointer_width = "32" => { fn foo() { /* non-unix, 32-bit functionality */ } } _ => { fn foo() { /* fallback implementation */ } } } let is_windows_str = cfg_select! { windows => "windows", _ => "not windows", };Rust 1.88 stabilized let chains. Rust 1.95 brings that capability into match expressions, allowing for conditionals based on pattern matching.
match value { Some(x) if let Ok(y) = compute(x) => { // Both `x` and `y` are available here println!("{}, {}", x, y); } _ => {} }Note that the compiler will not currently consider the patterns matched in
Stabilized APIsif letguards as part of the exhaustiveness evaluation of the overall match, just likeifguards.
MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>[MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>Cell<[T; N]>: AsRef<[Cell<T>; N]>Cell<[T; N]>: AsRef<[Cell<T>]>Cell<[T]>: AsRef<[Cell<T>]>bool: TryFrom<{integer}>AtomicPtr::updateAtomicPtr::try_updateAtomicBool::updateAtomicBool::try_updateAtomicIn::updateAtomicIn::try_updateAtomicUn::updateAtomicUn::try_updatecfg_select!mod core::rangecore::range::RangeInclusivecore::range::RangeInclusiveItercore::hint::cold_path<*const T>::as_ref_unchecked<*mut T>::as_ref_unchecked<*mut T>::as_mut_uncheckedVec::push_mutVec::insert_mutVecDeque::push_front_mutVecDeque::push_back_mutVecDeque::insert_mutLinkedList::push_front_mutLinkedList::push_back_mutLayout::dangling_ptrLayout::repeatLayout::repeat_packedLayout::extend_packedThese previously stable APIs are now stable in const contexts:
Destabilized JSON target specsRust 1.95 removes support on stable for passing a custom target specification to
rustc. This should not affect any Rust users using a fully stable toolchain, as building the standard library (including justcore) already required using nightly-only features.We're also gathering use cases for custom targets on the tracking issue as we consider whether some form of this feature should eventually be stabilized.
Other changesCheck out everything that changed in Rust, Cargo, and Clippy.
