Rust 1.86 released with trait objects upcasting, borrow checker improvements, and more
Rust has introduced version 1.86 of its programming language, featuring significant enhancements and bug fixes. A notable addition is the ability to upcast trait objects, allowing references to a trait object to be coerced to a supertrait object reference without requiring workaround methods. The borrow checker has also been improved to prevent simultaneous usage of references from repeated get_mut calls, with a new get_disjoint_mut helper introduced for safe mutable reference retrieval from slices and HashMap.
Additionally, the release stabilizes the target_feature_11 feature, enabling safe functions to be marked with the #[target_feature] attribute, previously reserved for unsafe functions. The compiler now includes debug assertions for non-null pointers during non-zero-sized reads, writes, and reborrowing. Furthermore, omitting the ABI in extern blocks and functions will now trigger a warning. Rust 1.86 also deprecates the i586-pc-windows-msvc target, and it will be removed in the next version of Rust. The update also includes stabilized APIs and various other enhancements and bug fixes.
