File _patchinfo of Package patchinfo.24558
<patchinfo incident="24558">
<packager>firstyear</packager>
<rating>moderate</rating>
<category>recommended</category>
<summary>Recommended update for rust, rust1.61</summary>
<description>This update for rust, rust1.61 fixes the following issues:
This updates ships rust1.61.
Version 1.61.0 (2022-05-19)
==========================
Language
--------
- `const fn` signatures can now include generic trait bounds
- `const fn` signatures can now use `impl Trait` in argument and return position
- Function pointers can now be created, cast, and passed around in a `const fn`
- Recursive calls can now set the value of a function's opaque `impl Trait` return type
Compiler
--------
- Linking modifier syntax in `#[link]` attributes and on the command line, as well as the `whole-archive` modifier specifically, are now supported
- The `char` type is now described as UTF-32 in debuginfo
- he [`#[target_feature]`][target_feature] attribute [can now be used with aarch64 features
- X86 [`#[target_feature = "adx"]` is now stable
Libraries
---------
- `ManuallyDrop<T>` is now documented to have the same layout as `T`
- `#[ignore = "…"]` messages are printed when running tests
- Consistently show absent stdio handles on Windows as NULL handles
- Make `std::io::stdio::lock()` return `'static` handles. Previously, the creation of locked handles to stdin/stdout/stderr would borrow the handles being locked, which prevented writing `let out = std::io::stdout().lock();` because `out` would outlive the return value of `stdout()`. Such code now works, eliminating a common pitfall that affected many Rust users.
- `Vec::from_raw_parts` is now less restrictive about its inputs
- `std::thread::available_parallelism` now takes cgroup quotas into account. Since `available_parallelism` is often used to create a thread pool for parallel computation, which may be CPU-bound for performance, `available_parallelism` will return a value consistent with the ability to use that many threads continuously, if possible. For instance, in a container with 8 virtual CPUs but quotas only allowing for 50% usage, `available_parallelism` will return 4.
Stabilized APIs
---------------
- `Pin::static_mut`
- `Pin::static_ref`
- `Vec::retain_mut`
- `VecDeque::retain_mut`
- `Write` for `Cursor<[u8; N]>`
- `std::os::unix::net::SocketAddr::from_pathname`
- `std::process::ExitCode` and `std::process::Termination`. The stabilization of these two APIs now makes it possible for programs to return errors from `main` with custom exit codes.
- `std::thread::JoinHandle::is_finished`]
These APIs are now usable in const contexts:
- `<*const T>::offset` and `<*mut T>::offset`
- `<*const T>::wrapping_offset` and `<*mut T>::wrapping_offset`
- `<*const T>::add` and `<*mut T>::add`
- `<*const T>::sub` and `<*mut T>::sub`
- `<*const T>::wrapping_add` and `<*mut T>::wrapping_add`
- `<*const T>::wrapping_sub` and `<*mut T>::wrapping_sub`
- `<[T]>::as_mut_ptr`
- `<[T]>::as_ptr_range`
- `<[T]>::as_mut_ptr_range`
Cargo
-----
No feature changes, but see compatibility notes.
Compatibility Notes
-------------------
- Previously native static libraries were linked as `whole-archive` in some cases, but now rustc tries not to use `whole-archive` unless explicitly requested. This change may result in linking errors in some cases. To fix such errors, native libraries linked from the command line, build scripts, or [`#[link]` attributes][link-attr] need to
- (more common) either be reordered to respect dependencies between them (if `a` depends on `b` then `a` should go first and `b` second)
- (less common) or be updated to use the [`+whole-archive`] modifier.
- Catching a second unwind from FFI code while cleaning up from a Rust panic now causes the process to abort
- Proc macros no longer see `ident` matchers wrapped in groups
- The number of `#` in `r#` raw string literals is now required to be less than 256
- When checking that a dyn type satisfies a trait bound, supertrait bounds are now enforced
- `cargo vendor` now only accepts one value for each `--sync` flag
- `cfg` predicates in `all()` and `any()` are always evaluated to detect errors, instead of short-circuiting. The compatibility considerations here arise in nightly-only code that used the short-circuiting behavior of `all` to write something like `cfg(all(feature = "nightly", syntax-requiring-nightly))`, which will now fail to compile. Instead, use either `cfg_attr(feature = "nightly", ...)` or nested uses of `cfg`.
- bootstrap: static-libstdcpp is now enabled by default, and can now be disabled when llvm-tools is enabled
</description>
</patchinfo>