Preview
Open Original
Language
- Stabilize several s390x vector-related target features and the is_s390x_feature_detected! macro
- Stabilize declaration of C-style variadic functions for the system ABI
- Emit error when using some keyword as a cfg predicate
- Stabilize asm_cfg
- During const-evaluation, support copying pointers byte-by-byte
- LUB coercions now correctly handle function item types, and functions with differing safeties
- [Allow const items that contain mutable references to static (which is very u…
Language
- Stabilize several s390x vector-related target features and the is_s390x_feature_detected! macro
- Stabilize declaration of C-style variadic functions for the system ABI
- Emit error when using some keyword as a cfg predicate
- Stabilize asm_cfg
- During const-evaluation, support copying pointers byte-by-byte
- LUB coercions now correctly handle function item types, and functions with differing safeties
- Allow const items that contain mutable references to static (which is very unsafe, but not always UB)
- Add warn-by-default const_item_interior_mutations lint to warn against calls which mutate interior mutable const items
- Add warn-by-default function_casts_as_integer lint
Compiler
- Stabilize -Cjump-tables=bool. The flag was previously called
-Zno-jump-tables.
Platform Support
Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries
- Stop internally using specialization on the Copy trait as it is unsound in the presence of lifetime dependent Copy implementations. This may result in some performance regressions as some standard library APIs may now call Clone::clone instead of performing bitwise copies
- Allow the global allocator to use thread-local storage and std::thread::current()
- Make BTree::append not update existing keys when appending an entry which already exists
- Don’t require T: RefUnwindSafe for vec::IntoIter<T>: UnwindSafe
Stabilized APIs
- <[MaybeUninit<T>]>::assume_init_drop
- <[MaybeUninit<T>]>::assume_init_ref
- <[MaybeUninit<T>]>::assume_init_mut
- <[MaybeUninit<T>]>::write_copy_of_slice
- <[MaybeUninit<T>]>::write_clone_of_slice
- String::into_raw_parts
- Vec::into_raw_parts
- <iN>::unchecked_neg
- <iN>::unchecked_shl
- <iN>::unchecked_shr
- <uN>::unchecked_shl
- <uN>::unchecked_shr
- <[T]>::as_array
- <[T]>::as_array_mut
- <*const [T]>::as_array
- <*mut [T]>::as_array_mut
- VecDeque::pop_front_if
- VecDeque::pop_back_if
- Duration::from_nanos_u128
- char::MAX_LEN_UTF8
- char::MAX_LEN_UTF16
- std::fmt::from_fn
- std::fmt::FromFn
Cargo
- Enable CARGO_CFG_DEBUG_ASSERTIONS in build scripts based on profile
- In cargo tree, support long forms for –format variables
- Add –workspace to cargo clean
Rustdoc
- Remove #![doc(document_private_items)]
- Include attribute and derive macros in search filters for "macros"
- Include extern crates in search filters for import
- Validate usage of crate-level doc attributes. This means if any of
html_favicon_url,html_logo_url,html_playground_url,issue_tracker_base_url, orhtml_no_sourceeither has a missing value, an unexpected value, or a value of the wrong type, rustdoc will emit the deny-by-default lintrustdoc::invalid_doc_attributes.
Compatibility Notes
- Introduce pin_v2 into the builtin attributes namespace
- Update bundled musl to 1.2.5
- On Emscripten, the unwinding ABI used when compiling with panic=unwind was changed from the JS exception handling ABI to the wasm exception handling ABI. If linking C/C++ object files with Rust objects,
-fwasm-exceptionsmust be passed to the linker now. On nightly Rust, it is possible to get the old behavior with-Zwasm-emscripten-eh=false -Zbuild-std, but it will be removed in a future release. - The
#[test]attribute, used to define tests, was previously ignored in various places where it had no meaning (e.g on trait methods or types). Putting the#[test]attribute in these places is no longer ignored, and will now result in an error; this may also result in errors when generating rustdoc. Error when test attribute is applied to structs - Cargo now sets the
CARGO_CFG_DEBUG_ASSERTIONSenvironment variable in more situations. This will cause crates depending onstatic-initversions 1.0.1 to 1.0.3 to fail compilation with "failed to resolve: use of unresolved module or unlinked crateparking_lot". See the linked issue for details. - User written types in the offset_of! macro are now checked to be well formed.
cargo publishno longer emits.cratefiles as a final artifact for user access when thebuild.build-dirconfig is unset- Upgrade the deref_nullptr lint from warn-by-default to deny-by-default
- Add future-incompatibility warning for ... function parameters without a pattern outside of extern blocks
- Introduce future-compatibility warning for repr(C) enums whose discriminant values do not fit into a c_int or c_uint
- Introduce future-compatibility warning against ignoring repr(C) types as part of repr(transparent)