Up to [cvs.NetBSD.org] / pkgsrc / lang / rust
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
rust: update to 1.94.1. Based on wip/rust194 by he@, adam@, pin@, jperkin@ 3 major versions since the previous pkgsrc version.
rust: update to 1.88
Prepared by he@ in wip/rust188.
Changes:
1.88
Language
Stabilize #![feature(let_chains)] in the 2024 edition. This feature allows &&-chaining let statements inside if and while, allowing intermixture with boolean expressions. The patterns inside the let sub-expressions can be irrefutable or refutable.
Stabilize #![feature(naked_functions)]. Naked functions allow writing functions with no compiler-generated epilogue and prologue, allowing full control over the generated assembly for a particular function.
Stabilize #![feature(cfg_boolean_literals)]. This allows using boolean literals as cfg predicates, e.g. #[cfg(true)] and #[cfg(false)].
Fully de-stabilize the #[bench] attribute. Usage of #[bench] without #![feature(custom_test_frameworks)] already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error.
Add warn-by-default dangerous_implicit_autorefs lint against implicit autoref of raw pointer dereference. The lint will be bumped to deny-by-default in the next version of Rust.
Add invalid_null_arguments lint to prevent invalid usage of null pointers. This lint is uplifted from clippy::invalid_null_ptr_usage.
Change trait impl candidate preference for builtin impls and trivial where-clauses.
Check types of generic const parameter defaults
Compiler
Stabilize -Cdwarf-version for selecting the version of DWARF debug information to generate.
Platform Support
Demote i686-pc-windows-gnu to Tier 2.
Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries
Remove backticks from #[should_panic] test failure message.
Guarantee that [T; N]::from_fn is generated in order of increasing indices., for those passing it a stateful closure.
The libtest flag --nocapture is deprecated in favor of the more consistent --no-capture flag.
Guarantee that {float}::NAN is a quiet NaN.
Stabilized APIs
Cell::update
impl Default for *const T
impl Default for *mut T
HashMap::extract_if
HashSet::extract_if
proc_macro::Span::line
proc_macro::Span::column
proc_macro::Span::start
proc_macro::Span::end
proc_macro::Span::file
proc_macro::Span::local_file
These previously stable APIs are now stable in const contexts:
NonNull<T>::replace
<*mut T>::replace
std::ptr::swap_nonoverlapping
Cell::{replace, get, get_mut, from_mut, as_slice_of_cells}
Cargo
Stabilize automatic garbage collection.
use zlib-rs for gzip compression in rust code
Rustdoc
Doctests can be ignored based on target names using ignore-* attributes.
Stabilize the --test-runtool and --test-runtool-arg CLI options to specify a program (like qemu) and its arguments to run a doctest.
Compatibility Notes
Finish changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a tt fragment specifier can often fix these macros.
Fully de-stabilize the #[bench] attribute. Usage of #[bench] without #![feature(custom_test_frameworks)] already triggered a deny-by-default future-incompatibility lint since Rust 1.77, but will now become a hard error.
Fix borrow checking some always-true patterns. The borrow checker was overly permissive in some cases, allowing programs that shouldn’t have compiled.
Update the minimum external LLVM to 19.
Make it a hard error to use a vector type with a non-Rust ABI without enabling the required target feature.
1.87
Language
Stabilize asm_goto feature
Allow parsing open beginning ranges (..EXPR) after unary operators !, -, and *.
Don’t require method impls for methods with Self: Sized bounds in impls for unsized types
Stabilize feature(precise_capturing_in_traits) allowing use<...> bounds on return position impl Trait in traits
Compiler
x86: make SSE2 required for i686 targets and use it to pass SIMD types
Platform Support
Remove i586-pc-windows-msvc target
Refer to Rust’s platform support page for more information on Rust’s tiered platform support.
Libraries
Stabilize the anonymous pipe API
Add support for unbounded left/right shift operations
Print pointer metadata in Debug impl of raw pointers
Vec::with_capacity guarantees it allocates with the amount requested, even if Vec::capacity returns a different number.
Most std::arch intrinsics which don’t take pointer arguments can now be called from safe code if the caller has the appropriate target features already enabled (https://github.com/rust-lang/stdarch/pull/1714, https://github.com/rust-lang/stdarch/pull/1716, https://github.com/rust-lang/stdarch/pull/1717)
Undeprecate env::home_dir
Denote ControlFlow as #[must_use]
Macros such as assert_eq! and vec! now support const {...} expressions
Stabilized APIs
Vec::extract_if
vec::ExtractIf
LinkedList::extract_if
linked_list::ExtractIf
<[T]>::split_off
<[T]>::split_off_mut
<[T]>::split_off_first
<[T]>::split_off_first_mut
<[T]>::split_off_last
<[T]>::split_off_last_mut
String::extend_from_within
os_str::Display
OsString::display
OsStr::display
io::pipe
io::PipeReader
io::PipeWriter
impl From<PipeReader> for OwnedHandle
impl From<PipeWriter> for OwnedHandle
impl From<PipeReader> for Stdio
impl From<PipeWriter> for Stdio
impl From<PipeReader> for OwnedFd
impl From<PipeWriter> for OwnedFd
Box<MaybeUninit<T>>::write
impl TryFrom<Vec<u8>> for String
<*const T>::offset_from_unsigned
<*const T>::byte_offset_from_unsigned
<*mut T>::offset_from_unsigned
<*mut T>::byte_offset_from_unsigned
NonNull::offset_from_unsigned
NonNull::byte_offset_from_unsigned
<uN>::cast_signed
NonZero::<uN>::cast_signed.
<iN>::cast_unsigned.
NonZero::<iN>::cast_unsigned.
<uN>::is_multiple_of
<uN>::unbounded_shl
<uN>::unbounded_shr
<iN>::unbounded_shl
<iN>::unbounded_shr
<iN>::midpoint
<str>::from_utf8
<str>::from_utf8_mut
<str>::from_utf8_unchecked
<str>::from_utf8_unchecked_mut
These previously stable APIs are now stable in const contexts:
core::str::from_utf8_mut
<[T]>::copy_from_slice
SocketAddr::set_ip
SocketAddr::set_port,
SocketAddrV4::set_ip
SocketAddrV4::set_port,
SocketAddrV6::set_ip
SocketAddrV6::set_port
SocketAddrV6::set_flowinfo
SocketAddrV6::set_scope_id
char::is_digit
char::is_whitespace
<[[T; N]]>::as_flattened
<[[T; N]]>::as_flattened_mut
String::into_bytes
String::as_str
String::capacity
String::as_bytes
String::len
String::is_empty
String::as_mut_str
String::as_mut_vec
Vec::as_ptr
Vec::as_slice
Vec::capacity
Vec::len
Vec::is_empty
Vec::as_mut_slice
Vec::as_mut_ptr
Cargo
Add terminal integration via ANSI OSC 9;4 sequences
chore: bump openssl to v3
feat(package): add –exclude-lockfile flag
Compatibility Notes
Rust now raises an error for macro invocations inside the #![crate_name] attribute
Unstable fields are now always considered to be inhabited
Macro arguments of unary operators followed by open beginning ranges may now be matched differently
Make Debug impl of raw pointers print metadata if present
Warn against function pointers using unsupported ABI strings in dependencies
Associated types on dyn types are no longer deduplicated
Forbid attributes on .. inside of struct patterns (let Struct { #[attribute] .. }) =
Make ptr_cast_add_auto_to_object lint into hard error
Many std::arch intrinsics are now safe to call in some contexts, there may now be new unused_unsafe warnings in existing codebases.
Limit width and precision formatting options to 16 bits on all targets
Turn order dependent trait objects future incompat warning into a hard error
Denote ControlFlow as #[must_use]
Windows: The standard library no longer links advapi32, except on win7. Code such as C libraries that were relying on this assumption may need to explicitly link advapi32.
Proc macros can no longer observe expanded cfg(true) attributes.
Start changing the internal representation of pasted tokens. Certain invalid declarative macros that were previously accepted in obscure circumstances are now correctly rejected by the compiler. Use of a tt fragment specifier can often fix these macros.
Don’t allow flattened format_args in const.
Internal Changes
These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools.
Update to LLVM 20
lang/rust: update to version 1.86.0 from pkgsrc-wip.
Pkgsrc changes:
* Drop support for building now old 1.76.0 rust natively on 32-bit
NetBSD arm ports, pushing those to use the rust-bin variant instead.
* Use of newer GCC on NetBSD/powerpc turned out to not be required,
given that your kernel and user-land is new enough. >= 10.0 release?
* Checksum updates.
Upstream changes:
Version 1.86.0 (2025-04-03)
==========================
Language
--------
- [Stabilize upcasting trait objects to supertraits.]
(https://github.com/rust-lang/rust/pull/134367)
- [Allow safe functions to be marked with the `#[target_feature]` attribute.]
(https://github.com/rust-lang/rust/pull/134090)
- [The `missing_abi` lint now warns-by-default.]
(https://github.com/rust-lang/rust/pull/132397)
- Rust now lints about double negations, to catch cases that might
have intended to be a prefix decrement operator (`--x`) as written
in other languages. This was previously a clippy lint,
`clippy::double_neg`, and is [now available directly in Rust as
`double_negations`.]
(https://github.com/rust-lang/rust/pull/126604)
- [More pointers are now detected as definitely not-null based on
their alignment in const eval.]
(https://github.com/rust-lang/rust/pull/133700)
- [Empty `repr()` attribute applied to invalid items are now
correctly rejected.]
(https://github.com/rust-lang/rust/pull/133925)
- [Inner attributes `#![test]` and `#![rustfmt::skip]` are no longer
accepted in more places than intended.]
(https://github.com/rust-lang/rust/pull/134276)
Compiler
--------
- [Debug-assert that raw pointers are non-null on access.]
(https://github.com/rust-lang/rust/pull/134424)
- [Change `-O` to mean `-C opt-level=3` instead of `-C opt-level=2`
to match Cargo's defaults.]
(https://github.com/rust-lang/rust/pull/135439)
- [Fix emission of `overflowing_literals` under certain macro environments.]
(https://github.com/rust-lang/rust/pull/136393)
Platform Support
----------------
- [Replace `i686-unknown-redox` target with `i586-unknown-redox`.]
(https://github.com/rust-lang/rust/pull/136698)
- [Increase baseline CPU of `i686-unknown-hurd-gnu` to Pentium 4.]
(https://github.com/rust-lang/rust/pull/136700)
- New tier 3 targets:
- [`{aarch64-unknown,x86_64-pc}-nto-qnx710_iosock`]
(https://github.com/rust-lang/rust/pull/133631).
For supporting Neutrino QNX 7.1 with `io-socket` network stack.
- [`{aarch64-unknown,x86_64-pc}-nto-qnx800`]
(https://github.com/rust-lang/rust/pull/133631).
For supporting Neutrino QNX 8.0 (`no_std`-only).
- [`{x86_64,i686}-win7-windows-gnu`]
(https://github.com/rust-lang/rust/pull/134609).
Intended for backwards compatibility with Windows 7.
`{x86_64,i686}-win7-windows-msvc` are the Windows MSVC counterparts
that already exist as Tier 3 targets.
- [`amdgcn-amd-amdhsa`](https://github.com/rust-lang/rust/pull/134740).
- [`x86_64-pc-cygwin`](https://github.com/rust-lang/rust/pull/134999).
- [`{mips,mipsel}-mti-none-elf`]
(https://github.com/rust-lang/rust/pull/135074).
Initial bare-metal support.
- [`m68k-unknown-none-elf`](https://github.com/rust-lang/rust/pull/135085).
- [`armv7a-nuttx-{eabi,eabihf}`, `aarch64-unknown-nuttx`, and
`thumbv7a-nuttx-{eabi,eabihf}`]
(https://github.com/rust-lang/rust/pull/135757).
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- The type of `FromBytesWithNulError` in `CStr::from_bytes_with_nul(bytes:
&[u8]) -> Result<&Self, FromBytesWithNulError>` was [changed from
an opaque struct to an enum]
(https://github.com/rust-lang/rust/pull/134143), allowing users
to examine why the conversion failed.
- [Remove `RustcDecodable` and `RustcEncodable`.]
(https://github.com/rust-lang/rust/pull/134272)
- [Deprecate libtest's `--logfile` option.]
(https://github.com/rust-lang/rust/pull/134283)
- [On recent versions of Windows, `std::fs::remove_file` will now
remove read-only files.]
(https://github.com/rust-lang/rust/pull/134679)
Stabilized APIs
---------------
- [`{float}::next_down`]
(https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_down)
- [`{float}::next_up`]
(https://doc.rust-lang.org/stable/std/primitive.f64.html#method.next_up)
- [`<[_]>::get_disjoint_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_mut)
- [`<[_]>::get_disjoint_unchecked_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.get_disjoint_unchecked_mut)
- [`slice::GetDisjointMutError`]
(https://doc.rust-lang.org/stable/std/slice/enum.GetDisjointMutError.html)
- [`HashMap::get_disjoint_mut`]
(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_mut)
- [`HashMap::get_disjoint_unchecked_mut`]
(https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.get_disjoint_unchecked_mut)
- [`NonZero::count_ones`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZero.html#method.count_ones)
- [`Vec::pop_if`]
(https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pop_if)
- [`sync::Once::wait`]
(https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait)
- [`sync::Once::wait_force`]
(https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.wait_force)
- [`sync::OnceLock::wait`]
(https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html#method.wait)
These APIs are now stable in const contexts:
- [`hint::black_box`]
(https://doc.rust-lang.org/stable/std/hint/fn.black_box.html)
- [`io::Cursor::get_mut`]
(https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_mut)
- [`io::Cursor::set_position`]
(https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.set_position)
- [`str::is_char_boundary`]
(https://doc.rust-lang.org/stable/std/primitive.str.html#method.is_char_boundary)
- [`str::split_at`]
(https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at)
- [`str::split_at_checked`]
(https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_checked)
- [`str::split_at_mut`]
(https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut)
- [`str::split_at_mut_checked`]
(https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_at_mut_checked)
Cargo
-----
- [When merging, replace rather than combine configuration keys
that refer to a program path and its arguments.]
(https://github.com/rust-lang/cargo/pull/15066/)
- [Error if both `--package` and `--workspace` are passed but the
requested package is missing.]
(https://github.com/rust-lang/cargo/pull/15071/) This was previously
silently ignored, which was considered a bug since missing packages
should be reported.
- [Deprecate the token argument in `cargo login` to avoid shell history leaks.]
(https://github.com/rust-lang/cargo/pull/15057/)
- [Simplify the implementation of `SourceID` comparisons.]
(https://github.com/rust-lang/cargo/pull/14980/) This may
potentially change behavior if the canonicalized URL compares
differently in alternative registries.
Rustdoc
-----
- [Add a sans-serif font setting.]
(https://github.com/rust-lang/rust/pull/133636)
Compatibility Notes
-------------------
- [The `wasm_c_abi` future compatibility warning is now a hard error.]
(https://github.com/rust-lang/rust/pull/133951)
Users of `wasm-bindgen` should upgrade to at least version 0.2.89,
otherwise compilation will fail.
- [Remove long-deprecated no-op attributes `#![no_start]` and `#![crate_id]`.]
(https://github.com/rust-lang/rust/pull/134300)
- [The future incompatibility lint `cenum_impl_drop_cast` has been
made into a hard error.]
(https://github.com/rust-lang/rust/pull/135964) This means it is
now an error to cast a field-less enum to an integer if the enum
implements `Drop`.
- [SSE2 is now required for "i686" 32-bit x86 hard-float targets;
disabling it causes a warning that will become a hard error
eventually.]
(https://github.com/rust-lang/rust/pull/137037) To compile for
pre-SSE2 32-bit x86, use a "i586" target instead.
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Build the rustc on AArch64 Linux with ThinLTO + PGO.]
(https://github.com/rust-lang/rust/pull/133807)
The ARM 64-bit compiler (AArch64) on Linux is now optimized with
ThinLTO and PGO, similar to the optimizations we have already
performed for the x86-64 compiler on Linux. This should make it
up to 30% faster.
rust: update to 1.85.1. Based on wip/rust185, mostly by he@ with help from bsiegert@, adam@, and myself, and hints from riastradh@.
lang/rust: update to version 1.81.0, taken from pkgsrc-wip.
Pkgsrc changes:
* Adapt patches, apply to new vendored crates where needed.
* Back-port rust pull request 130110, "make dist vendoring configurable"
* Disable "dist vendoring", otherwise cargo would try to access
the network during the build phase.
Upstream changes:
Version 1.81.0 (2024-09-05)
==========================
Language
--------
- [Abort on uncaught panics in `extern "C"` functions.]
(https://github.com/rust-lang/rust/pull/116088/)
- [Fix ambiguous cases of multiple `&` in elided self lifetimes.]
(https://github.com/rust-lang/rust/pull/117967/)
- [Stabilize `#[expect]` for lints (RFC 2383),]
(https://github.com/rust-lang/rust/pull/120924/) like `#[allow]`
with a warning if the lint is _not_ fulfilled.
- [Change method resolution to constrain hidden types instead of
rejecting method candidates.]
(https://github.com/rust-lang/rust/pull/123962/)
- [Bump `elided_lifetimes_in_associated_constant` to deny.]
(https://github.com/rust-lang/rust/pull/124211/)
- [`offset_from`: always allow pointers to point to the same
address.] (https://github.com/rust-lang/rust/pull/124921/)
- [Allow constraining opaque types during subtyping in the trait
system.] (https://github.com/rust-lang/rust/pull/125447/)
- [Allow constraining opaque types during various unsizing casts.]
(https://github.com/rust-lang/rust/pull/125610/)
- [Deny keyword lifetimes pre-expansion.]
(https://github.com/rust-lang/rust/pull/126762/)
Compiler
--------
- [Make casts of pointers to trait objects stricter.]
(https://github.com/rust-lang/rust/pull/120248/)
- [Check alias args for well-formedness even if they have escaping
bound vars.] (https://github.com/rust-lang/rust/pull/123737/)
- [Deprecate no-op codegen option `-Cinline-threshold=...`.]
(https://github.com/rust-lang/rust/pull/124712/)
- [Re-implement a type-size based limit.]
(https://github.com/rust-lang/rust/pull/125507/)
- [Properly account for alignment in `transmute` size checks.]
(https://github.com/rust-lang/rust/pull/125740/)
- [Remove the `box_pointers` lint.]
(https://github.com/rust-lang/rust/pull/126018/)
- [Ensure the interpreter checks bool/char for validity when they
are used in a cast.] (https://github.com/rust-lang/rust/pull/126265/)
- [Improve coverage instrumentation for functions containing nested
items.] (https://github.com/rust-lang/rust/pull/127199/)
- Target changes:
- [Add Tier 3 `no_std` Xtensa targets:]
(https://github.com/rust-lang/rust/pull/125141/) `xtensa-esp32-none-elf`,
`xtensa-esp32s2-none-elf`, `xtensa-esp32s3-none-elf`
- [Add Tier 3 `std` Xtensa targets:]
(https://github.com/rust-lang/rust/pull/126380/) `xtensa-esp32-espidf`,
`xtensa-esp32s2-espidf`, `xtensa-esp32s3-espidf`
- [Add Tier 3 i686 Redox OS target:]
(https://github.com/rust-lang/rust/pull/126192/) `i686-unknown-redox`
- [Promote `arm64ec-pc-windows-msvc` to Tier 2.]
(https://github.com/rust-lang/rust/pull/126039/)
- [Promote `wasm32-wasip2` to Tier 2.]
(https://github.com/rust-lang/rust/pull/126967/)
- [Promote `loongarch64-unknown-linux-musl` to Tier 2 with host
tools.] (https://github.com/rust-lang/rust/pull/126298/)
- [Enable full tools and profiler for LoongArch Linux targets.]
(https://github.com/rust-lang/rust/pull/127078/)
- [Unconditionally warn on usage of `wasm32-wasi`.]
(https://github.com/rust-lang/rust/pull/126662/) (see compatibility
note below)
- Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- [Split core's `PanicInfo` and std's `PanicInfo`.]
(https://github.com/rust-lang/rust/pull/115974/) (see compatibility
note below)
- [Generalize `{Rc,Arc}::make_mut()` to unsized types.]
(https://github.com/rust-lang/rust/pull/116113/)
- [Replace sort implementations with stable `driftsort` and unstable
`ipnsort`.] (https://github.com/rust-lang/rust/pull/124032/) All
`slice::sort*` and `slice::select_nth*` methods are expected to
see significant performance improvements. See the [research
project] (https://github.com/Voultapher/sort-research-rs) for
more details.
- [Document behavior of `create_dir_all` with respect to empty
paths.] (https://github.com/rust-lang/rust/pull/125112/)
- [Fix interleaved output in the default panic hook when multiple
threads panic simultaneously.]
(https://github.com/rust-lang/rust/pull/127397/)
- Fix `Command`'s batch files argument escaping not working when
file name has trailing whitespace or periods (CVE-2024-43402).
Stabilized APIs
---------------
- [`core::error`] (https://doc.rust-lang.org/stable/core/error/index.html)
- [`hint::assert_unchecked`]
(https://doc.rust-lang.org/stable/core/hint/fn.assert_unchecked.html)
- [`fs::exists`] (https://doc.rust-lang.org/stable/std/fs/fn.exists.html)
- [`AtomicBool::fetch_not`]
(https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.fetch_not)
- [`Duration::abs_diff`]
(https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.abs_diff)
- [`IoSlice::advance`]
(https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance)
- [`IoSlice::advance_slices`]
(https://doc.rust-lang.org/stable/std/io/struct.IoSlice.html#method.advance_slices)
- [`IoSliceMut::advance`]
(https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance)
- [`IoSliceMut::advance_slices`]
(https://doc.rust-lang.org/stable/std/io/struct.IoSliceMut.html#method.advance_slices)
- [`PanicHookInfo`]
(https://doc.rust-lang.org/stable/std/panic/struct.PanicHookInfo.html)
- [`PanicInfo::message`]
(https://doc.rust-lang.org/stable/core/panic/struct.PanicInfo.html#method.message)
- [`PanicMessage`]
(https://doc.rust-lang.org/stable/core/panic/struct.PanicMessage.html)
These APIs are now stable in const contexts:
- [`char::from_u32_unchecked`]
(https://doc.rust-lang.org/stable/core/char/fn.from_u32_unchecked.html)
(function)
- [`char::from_u32_unchecked`]
(https://doc.rust-lang.org/stable/core/primitive.char.html#method.from_u32_unchecked)
(method)
- [`CStr::count_bytes`]
(https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
- [`CStr::from_ptr`]
(https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.from_ptr)
Cargo
-----
- [Generated `.cargo_vcs_info.json` is always included, even when
`--allow-dirty` is passed.]
(https://github.com/rust-lang/cargo/pull/13960/)
- [Disallow `package.license-file` and `package.readme` pointing
to non-existent files during packaging.]
(https://github.com/rust-lang/cargo/pull/13921/)
- [Disallow passing `--release`/`--debug` flag along with the
`--profile` flag.] (https://github.com/rust-lang/cargo/pull/13971/)
- [Remove `lib.plugin` key support in `Cargo.toml`. Rust plugin
support has been deprecated for four years and was removed in
1.75.0.] (https://github.com/rust-lang/cargo/pull/13902/)
Compatibility Notes
-------------------
* Usage of the `wasm32-wasi` target will now issue a compiler
warning and request users switch to the `wasm32-wasip1` target
instead. Both targets are the same, `wasm32-wasi` is only being
renamed, and this [change to the WASI target]
(https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html)
is being done to enable removing `wasm32-wasi` in January 2025.
* We have renamed `std::panic::PanicInfo` to `std::panic::PanicHookInfo`.
The old name will continue to work as an alias, but will result in
a deprecation warning starting in Rust 1.82.0.
`core::panic::PanicInfo` will remain unchanged, however, as this
is now a *different type*.
The reason is that these types have different roles:
`std::panic::PanicHookInfo` is the argument to the [panic
hook](https://doc.rust-lang.org/stable/std/panic/fn.set_hook.html)
in std context (where panics can have an arbitrary payload),
while `core::panic::PanicInfo` is the argument to the
[`#[panic_handler]`](https://doc.rust-lang.org/nomicon/panic-handler.html)
in no_std context (where panics always carry a formatted *message*).
Separating these types allows us to add more useful methods to
these types, such as `std::panic::PanicHookInfo::payload_as_str()`
and `core::panic::PanicInfo::message()`.
* The new sort implementations may panic if a type's implementation
of [`Ord`](https://doc.rust-lang.org/std/cmp/trait.Ord.html) (or
the given comparison function) does not implement a [total
order](https://en.wikipedia.org/wiki/Total_order) as the trait
requires. `Ord`'s supertraits (`PartialOrd`, `Eq`, and `PartialEq`)
must also be consistent. The previous implementations would not
"notice" any problem, but the new implementations have a good chance
of detecting inconsistencies, throwing a panic rather than returning
knowingly unsorted data.
* [In very rare cases, a change in the internal evaluation order of the trait
solver may result in new fatal overflow errors.]
(https://github.com/rust-lang/rust/pull/126128)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals
of rustc and related tools.
- [Add a Rust-for Linux `auto` CI job to check kernel builds.]
(https://github.com/rust-lang/rust/pull/125209/)
lang/rust: update to version 1.80.1.
This is based on the pkgsrc-wip rust180 package, retaining
the main pkgsrc changes as best as I could.
Pkgsrc changes:
* Adapt checksums and patches.
* Make this work again on big-endian aarch64 (at least on NetBSD).
* Make the choice of GCC = 12 work for sparc64 by testing options
after options.mk is included (which is required...). Makes this
work on NetBSD/sparc64 10.0 again.
Upstream chnages:
Version 1.80.1 (2024-08-08)
===========================
- [Fix miscompilation in the jump threading MIR optimization when
comparing floats]
(https://github.com/rust-lang/rust/pull/128271)
- [Revert changes to the `dead_code` lint from 1.80.0]
(https://github.com/rust-lang/rust/pull/128618)
Version 1.80.0 (2024-07-25)
==========================
Language
--------
- [Document maximum allocation size]
(https://github.com/rust-lang/rust/pull/116675/)
- [Allow zero-byte offsets and ZST read/writes on arbitrary pointers]
(https://github.com/rust-lang/rust/pull/117329/)
- [Support C23's variadics without a named parameter]
(https://github.com/rust-lang/rust/pull/124048/)
- [Stabilize `exclusive_range_pattern` feature]
(https://github.com/rust-lang/rust/pull/124459/)
- [Guarantee layout and ABI of `Result` in some scenarios]
(https://github.com/rust-lang/rust/pull/124870)
Compiler
--------
- [Update cc crate to v1.0.97 allowing additional spectre mitigations
on MSVC targets]
(https://github.com/rust-lang/rust/pull/124892/)
- [Allow field reordering on types marked `repr(packed(1))`]
(https://github.com/rust-lang/rust/pull/125360/)
- [Add a lint against never type fallback affecting unsafe code]
(https://github.com/rust-lang/rust/pull/123939/)
- [Disallow cast with trailing braced macro in let-else]
(https://github.com/rust-lang/rust/pull/125049/)
- [Expand `for_loops_over_fallibles` lint to lint on fallibles
behind references.]
(https://github.com/rust-lang/rust/pull/125156/)
- [self-contained linker: retry linking without `-fuse-ld=lld` on
CCs that don't support it]
(https://github.com/rust-lang/rust/pull/125417/)
- [Do not parse CVarArgs (`...`) as a type in trait bounds]
(https://github.com/rust-lang/rust/pull/125863/)
- Improvements to LLDB formatting [#124458]
(https://github.com/rust-lang/rust/pull/124458) [#124500]
(https://github.com/rust-lang/rust/pull/124500)
- [For the wasm32-wasip2 target default to PIC and do not use `-fuse-ld=lld`]
(https://github.com/rust-lang/rust/pull/124858/)
- [Add x86_64-unknown-linux-none as a tier 3 target]
(https://github.com/rust-lang/rust/pull/125023/)
- [Lint on `foo.into_iter()` resolving to `&Box<[T]>: IntoIterator`]
(https://github.com/rust-lang/rust/pull/124097/)
Libraries
---------
- [Add `size_of` and `size_of_val` and `align_of` and `align_of_val`
to the prelude]
(https://github.com/rust-lang/rust/pull/123168/)
- [Abort a process when FD ownership is violated]
(https://github.com/rust-lang/rust/pull/124210/)
- [io::Write::write_fmt: panic if the formatter fails when the
stream does not fail]
(https://github.com/rust-lang/rust/pull/125012/)
- [Panic if `PathBuf::set_extension` would add a path separator]
(https://github.com/rust-lang/rust/pull/125070/)
- [Add assert_unsafe_precondition to unchecked_{add,sub,neg,mul,shl,shr}
methods] (https://github.com/rust-lang/rust/pull/121571/)
- [Update `c_char` on AIX to use the correct type]
(https://github.com/rust-lang/rust/pull/122986/)
- [`offset_of!` no longer returns a temporary]
(https://github.com/rust-lang/rust/pull/124484/)
- [Handle sigma in `str.to_lowercase` correctly]
(https://github.com/rust-lang/rust/pull/124773/)
- [Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB]
(https://github.com/rust-lang/rust/pull/126059/)
Stabilized APIs
---------------
- [`impl Default for Rc<CStr>`]
(https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3CCStr%3E)
- [`impl Default for Rc<str>`]
(https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3Cstr%3E)
- [`impl Default for Rc<[T]>`]
(https://doc.rust-lang.org/beta/alloc/rc/struct.Rc.html#impl-Default-for-Rc%3C%5BT%5D%3E)
- [`impl Default for Arc<str>`]
(https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E)
- [`impl Default for Arc<CStr>`]
(https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3CCStr%3E)
- [`impl Default for Arc<[T]>`]
(https://doc.rust-lang.org/beta/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3C%5BT%5D%3E)
- [`impl IntoIterator for Box<[T]>`]
(https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E)
- [`impl FromIterator<String> for Box<str>`]
(https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3CString%3E-for-Box%3Cstr%3E)
- [`impl FromIterator<char> for Box<str>`]
(https://doc.rust-lang.org/beta/alloc/boxed/struct.Box.html#impl-FromIterator%3Cchar%3E-for-Box%3Cstr%3E)
- [`LazyCell`]
(https://doc.rust-lang.org/beta/core/cell/struct.LazyCell.html)
- [`LazyLock`]
(https://doc.rust-lang.org/beta/std/sync/struct.LazyLock.html)
- [`Duration::div_duration_f32`]
(https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f32)
- [`Duration::div_duration_f64`]
(https://doc.rust-lang.org/beta/std/time/struct.Duration.html#method.div_duration_f64)
- [`Option::take_if`]
(https://doc.rust-lang.org/beta/std/option/enum.Option.html#method.take_if)
- [`Seek::seek_relative`]
(https://doc.rust-lang.org/beta/std/io/trait.Seek.html#method.seek_relative)
- [`BinaryHeap::as_slice`]
(https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.as_slice)
- [`NonNull::offset`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset)
- [`NonNull::byte_offset`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset)
- [`NonNull::add`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.add)
- [`NonNull::byte_add`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_add)
- [`NonNull::sub`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.sub)
- [`NonNull::byte_sub`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_sub)
- [`NonNull::offset_from`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.offset_from)
- [`NonNull::byte_offset_from`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.byte_offset_from)
- [`NonNull::read`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read)
- [`NonNull::read_volatile`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_volatile)
- [`NonNull::read_unaligned`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.read_unaligned)
- [`NonNull::write`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write)
- [`NonNull::write_volatile`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_volatile)
- [`NonNull::write_unaligned`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_unaligned)
- [`NonNull::write_bytes`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.write_bytes)
- [`NonNull::copy_to`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to)
- [`NonNull::copy_to_nonoverlapping`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_to_nonoverlapping)
- [`NonNull::copy_from`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from)
- [`NonNull::copy_from_nonoverlapping`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.copy_from_nonoverlapping)
- [`NonNull::replace`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.replace)
- [`NonNull::swap`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.swap)
- [`NonNull::drop_in_place`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.drop_in_place)
- [`NonNull::align_offset`]
(https://doc.rust-lang.org/beta/std/ptr/struct.NonNull.html#method.align_offset)
- [`<[T]>::split_at_checked`]
(https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_checked)
- [`<[T]>::split_at_mut_checked`]
(https://doc.rust-lang.org/beta/std/primitive.slice.html#method.split_at_mut_checked)
- [`str::split_at_checked`]
(https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_checked)
- [`str::split_at_mut_checked`]
(https://doc.rust-lang.org/beta/std/primitive.str.html#method.split_at_mut_checked)
- [`str::trim_ascii`]
(https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii)
- [`str::trim_ascii_start`]
(https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_start)
- [`str::trim_ascii_end`]
(https://doc.rust-lang.org/beta/std/primitive.str.html#method.trim_ascii_end)
- [`<[u8]>::trim_ascii`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii)
- [`<[u8]>::trim_ascii_start`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_start)
- [`<[u8]>::trim_ascii_end`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.trim_ascii_end)
- [`Ipv4Addr::BITS`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#associatedconstant.BITS)
- [`Ipv4Addr::to_bits`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.to_bits)
- [`Ipv4Addr::from_bits`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv4Addr.html#method.from_bits)
- [`Ipv6Addr::BITS`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#associatedconstant.BITS)
- [`Ipv6Addr::to_bits`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.to_bits)
- [`Ipv6Addr::from_bits`]
(https://doc.rust-lang.org/beta/core/net/struct.Ipv6Addr.html#method.from_bits)
- [`Vec::<[T; N]>::into_flattened`]
(https://doc.rust-lang.org/beta/alloc/vec/struct.Vec.html#method.into_flattened)
- [`<[[T; N]]>::as_flattened`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened)
- [`<[[T; N]]>::as_flattened_mut`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.as_flattened_mut)
These APIs are now stable in const contexts:
- [`<[T]>::last_chunk`]
(https://doc.rust-lang.org/beta/core/primitive.slice.html#method.last_chunk)
- [`BinaryHeap::new`]
(https://doc.rust-lang.org/beta/std/collections/struct.BinaryHeap.html#method.new)
Cargo
-----
- [Stabilize `-Zcheck-cfg` as always enabled]
(https://github.com/rust-lang/cargo/pull/13571/)
- [Warn, rather than fail publish, if a target is excluded]
(https://github.com/rust-lang/cargo/pull/13713/)
- [Add special `check-cfg` lint config for the `unexpected_cfgs` lint]
(https://github.com/rust-lang/cargo/pull/13913/)
- [Stabilize `cargo update --precise <yanked>`]
(https://github.com/rust-lang/cargo/pull/13974/)
- [Don't change file permissions on `Cargo.toml` when using `cargo add`]
(https://github.com/rust-lang/cargo/pull/13898/)
- [Support using `cargo fix` on IPv6-only networks]
(https://github.com/rust-lang/cargo/pull/13907/)
Rustdoc
-----
- [Allow searching for references]
(https://github.com/rust-lang/rust/pull/124148/)
- [Stabilize `custom_code_classes_in_docs` feature]
(https://github.com/rust-lang/rust/pull/124577/)
- [fix: In cross-crate scenarios show enum variants on type aliases of enums]
(https://github.com/rust-lang/rust/pull/125300/)
Compatibility Notes
-------------------
- [rustfmt estimates line lengths differently when using non-ascii characters]
(https://github.com/rust-lang/rustfmt/issues/6203)
- [Type aliases are now handled correctly in orphan check]
(https://github.com/rust-lang/rust/pull/117164/)
- [Allow instructing rustdoc to read from stdin via `-`]
(https://github.com/rust-lang/rust/pull/124611/)
- [`std::env::{set_var, remove_var}` can no longer be converted to
safe function pointers and no longer implement the `Fn` family of
traits]
(https://github.com/rust-lang/rust/pull/124636)
- [Warn (or error) when `Self` constructor from outer item is
referenced in inner nested item]
(https://github.com/rust-lang/rust/pull/124187/)
- [Turn `indirect_structural_match` and `pointer_structural_match`
lints into hard errors]
(https://github.com/rust-lang/rust/pull/124661/)
- [Make `where_clause_object_safety` lint a regular object safety violation]
(https://github.com/rust-lang/rust/pull/125380/)
- [Turn `proc_macro_back_compat` lint into a hard error.]
(https://github.com/rust-lang/rust/pull/125596/)
- [Detect unused structs even when implementing private traits]
(https://github.com/rust-lang/rust/pull/122382/)
- [`std::sync::ReentrantLockGuard<T>` is no longer `Sync` if `T: !Sync`]
(https://github.com/rust-lang/rust/pull/125527) which means
[`std::io::StdoutLock` and `std::io::StderrLock` are no longer
Sync] (https://github.com/rust-lang/rust/issues/127340)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- Misc improvements to size of generated html by rustdoc e.g. [#124738]
(https://github.com/rust-lang/rust/pull/124738/) and [#123734]
(https://github.com/rust-lang/rust/pull/123734/)
- [MSVC targets no longer depend on libc]
(https://github.com/rust-lang/rust/pull/124050/)
Version 1.79.0 (2024-06-13)
==========================
Language
--------
- [Stabilize inline `const {}` expressions.]
(https://github.com/rust-lang/rust/pull/104087/)
- [Prevent opaque types being instantiated twice with different
regions within the same function.]
(https://github.com/rust-lang/rust/pull/116935/)
- [Stabilize WebAssembly target features that are in phase 4 and 5.]
(https://github.com/rust-lang/rust/pull/117457/)
- [Add the `redundant_lifetimes` lint to detect lifetimes which
are semantically redundant.]
(https://github.com/rust-lang/rust/pull/118391/)
- [Stabilize the `unnameable_types` lint for public types that can't be named.]
(https://github.com/rust-lang/rust/pull/120144/)
- [Enable debuginfo in macros, and stabilize `-C collapse-macro-debuginfo`
and `#[collapse_debuginfo]`.]
(https://github.com/rust-lang/rust/pull/120845/)
- [Propagate temporary lifetime extension into `if` and `match` expressions.]
(https://github.com/rust-lang/rust/pull/121346/)
- [Restrict promotion of `const fn` calls.]
(https://github.com/rust-lang/rust/pull/121557/)
- [Warn against refining impls of crate-private traits with
`refining_impl_trait` lint.]
(https://github.com/rust-lang/rust/pull/121720/)
- [Stabilize associated type bounds (RFC 2289).]
(https://github.com/rust-lang/rust/pull/122055/)
- [Stabilize importing `main` from other modules or crates.]
(https://github.com/rust-lang/rust/pull/122060/)
- [Check return types of function types for well-formedness]
(https://github.com/rust-lang/rust/pull/115538)
- [Rework `impl Trait` lifetime inference]
(https://github.com/rust-lang/rust/pull/116891/)
- [Change inductive trait solver cycles to be ambiguous]
(https://github.com/rust-lang/rust/pull/122791)
Compiler
--------
- [Define `-C strip` to only affect binaries, not artifacts like `.pdb`.]
(https://github.com/rust-lang/rust/pull/115120/)
- [Stabilize `-Crelro-level` for controlling runtime link hardening.]
(https://github.com/rust-lang/rust/pull/121694/)
- [Stabilize checking of `cfg` names and values at compile-time
with `--check-cfg`.]
(https://github.com/rust-lang/rust/pull/123501/)
*Note that this only stabilizes the compiler part, the Cargo part
is still unstable in this release.*
- [Add `aarch64-apple-visionos` and `aarch64-apple-visionos-sim`
tier 3 targets.]
(https://github.com/rust-lang/rust/pull/121419/)
- [Add `riscv32ima-unknown-none-elf` tier 3 target.]
(https://github.com/rust-lang/rust/pull/122696/)
- [Promote several Windows targets to tier 2]
(https://github.com/rust-lang/rust/pull/121712):
`aarch64-pc-windows-gnullvm`, `i686-pc-windows-gnullvm`, and
`x86_64-pc-windows-gnullvm`.
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- [Implement `FromIterator` for `(impl Default + Extend, impl
Default + Extend)`.]
(https://github.com/rust-lang/rust/pull/107462/)
- [Implement `{Div,Rem}Assign<NonZero<X>>` on `X`.]
(https://github.com/rust-lang/rust/pull/121952/)
- [Document overrides of `clone_from()` in core/std.]
(https://github.com/rust-lang/rust/pull/122201/)
- [Link MSVC default lib in core.]
(https://github.com/rust-lang/rust/pull/122268/)
- [Caution against using `transmute` between pointers and integers.]
(https://github.com/rust-lang/rust/pull/122379/)
- [Enable frame pointers for the standard library.]
(https://github.com/rust-lang/rust/pull/122646/)
Stabilized APIs
---------------
- [`{integer}::unchecked_add`]
(https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_add)
- [`{integer}::unchecked_mul`]
(https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_mul)
- [`{integer}::unchecked_sub`]
(https://doc.rust-lang.org/stable/core/primitive.i32.html#method.unchecked_sub)
- [`<[T]>::split_at_unchecked`]
(https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_unchecked)
- [`<[T]>::split_at_mut_unchecked`]
(https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked)
- [`<[u8]>::utf8_chunks`]
(https://doc.rust-lang.org/stable/core/primitive.slice.html#method.utf8_chunks)
- [`str::Utf8Chunks`]
(https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunks.html)
- [`str::Utf8Chunk`]
(https://doc.rust-lang.org/stable/core/str/struct.Utf8Chunk.html)
- [`<*const T>::is_aligned`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned)
- [`<*mut T>::is_aligned`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_aligned-1)
- [`NonNull::is_aligned`]
(https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_aligned)
- [`<*const [T]>::len`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len)
- [`<*mut [T]>::len`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.len-1)
- [`<*const [T]>::is_empty`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty)
- [`<*mut [T]>::is_empty`]
(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_empty-1)
- [`NonNull::<[T]>::is_empty`]
(https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.is_empty)
- [`CStr::count_bytes`]
(https://doc.rust-lang.org/stable/core/ffi/c_str/struct.CStr.html#method.count_bytes)
- [`io::Error::downcast`]
(https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.downcast)
- [`num::NonZero<T>`]
(https://doc.rust-lang.org/stable/core/num/struct.NonZero.html)
- [`path::absolute`]
(https://doc.rust-lang.org/stable/std/path/fn.absolute.html)
- [`proc_macro::Literal::byte_character`]
(https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.byte_character)
- [`proc_macro::Literal::c_string`]
(https://doc.rust-lang.org/stable/proc_macro/struct.Literal.html#method.c_string)
These APIs are now stable in const contexts:
- [`Atomic*::into_inner`]
(https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.into_inner)
- [`io::Cursor::new`]
(https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.new)
- [`io::Cursor::get_ref`]
(https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.get_ref)
- [`io::Cursor::position`]
(https://doc.rust-lang.org/stable/std/io/struct.Cursor.html#method.position)
- [`io::empty`]
(https://doc.rust-lang.org/stable/std/io/fn.empty.html)
- [`io::repeat`]
(https://doc.rust-lang.org/stable/std/io/fn.repeat.html)
- [`io::sink`]
(https://doc.rust-lang.org/stable/std/io/fn.sink.html)
- [`panic::Location::caller`]
(https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.caller)
- [`panic::Location::file`]
(https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.file)
- [`panic::Location::line`]
(https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.line)
- [`panic::Location::column`]
(https://doc.rust-lang.org/stable/std/panic/struct.Location.html#method.column)
Cargo
-----
- [Prevent dashes in `lib.name`, always normalizing to `_`.]
(https://github.com/rust-lang/cargo/pull/12783/)
- [Stabilize MSRV-aware version requirement selection in `cargo add`.]
(https://github.com/rust-lang/cargo/pull/13608/)
- [Switch to using `gitoxide` by default for listing files.]
(https://github.com/rust-lang/cargo/pull/13696/)
Rustdoc
-----
- [Always display stability version even if it's the same as the
containing item.]
(https://github.com/rust-lang/rust/pull/118441/)
- [Show a single search result for items with multiple paths.]
(https://github.com/rust-lang/rust/pull/119912/)
- [Support typing `/` in docs to begin a search.]
(https://github.com/rust-lang/rust/pull/123355/)
Misc
----
Compatibility Notes
-------------------
- [Update the minimum external LLVM to 17.]
(https://github.com/rust-lang/rust/pull/122649/)
- [`RustcEncodable` and `RustcDecodable` are soft-destabilized, to
be removed from the prelude in next edition.]
(https://github.com/rust-lang/rust/pull/116016/)
- [The `wasm_c_abi` future-incompatibility lint will warn about use of the
non-spec-compliant C ABI.]
(https://github.com/rust-lang/rust/pull/117918/)
Use `wasm-bindgen v0.2.88` to generate forward-compatible bindings.
- [Check return types of function types for well-formedness]
(https://github.com/rust-lang/rust/pull/115538)
Version 1.78.0 (2024-05-02)
===========================
Language
--------
- [Stabilize `#[cfg(target_abi = ...)]`]
(https://github.com/rust-lang/rust/pull/119590/)
- [Stabilize the `#[diagnostic]` namespace and
`#[diagnostic::on_unimplemented]` attribute]
(https://github.com/rust-lang/rust/pull/119888/)
- [Make async-fn-in-trait implementable with concrete signatures]
(https://github.com/rust-lang/rust/pull/120103/)
- [Make matching on NaN a hard error, and remove the rest of
`illegal_floating_point_literal_pattern`]
(https://github.com/rust-lang/rust/pull/116284/)
- [static mut: allow mutable reference to arbitrary types, not just
slices and arrays]
(https://github.com/rust-lang/rust/pull/117614/)
- [Extend `invalid_reference_casting` to include references casting
to bigger memory layout]
(https://github.com/rust-lang/rust/pull/118983/)
- [Add `non_contiguous_range_endpoints` lint for singleton gaps
after exclusive ranges]
(https://github.com/rust-lang/rust/pull/118879/)
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions]
(https://github.com/rust-lang/rust/pull/117918/)
This lint currently only works when using Cargo.
- [Update `indirect_structural_match` and `pointer_structural_match`
lints to match RFC]
(https://github.com/rust-lang/rust/pull/120423/)
- [Make non-`PartialEq`-typed consts as patterns a hard error]
(https://github.com/rust-lang/rust/pull/120805/)
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants]
(https://github.com/rust-lang/rust/pull/121720/)
- [Remove unnecessary type inference when using associated types
inside of higher ranked `where`-bounds]
(https://github.com/rust-lang/rust/pull/119849)
- [Weaken eager detection of cyclic types during type inference]
(https://github.com/rust-lang/rust/pull/119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`]
(https://github.com/rust-lang/rust/pull/119338)
Compiler
--------
- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default]
(https://github.com/rust-lang/rust/pull/111505/)
- [Increase accuracy of redundant `use` checking]
(https://github.com/rust-lang/rust/pull/117772/)
- [Suggest moving definition if non-found macro_rules! is defined later]
(https://github.com/rust-lang/rust/pull/121130/)
- [Lower transmutes from int to pointer type as gep on null]
(https://github.com/rust-lang/rust/pull/121282/)
Target changes:
- [Windows tier 1 targets now require at least Windows 10]
(https://github.com/rust-lang/rust/pull/115141/)
- [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows]
(https://github.com/rust-lang/rust/pull/120820/)
- [Add `wasm32-wasip1` tier 2 (without host tools) target]
(https://github.com/rust-lang/rust/pull/120468/)
- [Add `wasm32-wasip2` tier 3 target]
(https://github.com/rust-lang/rust/pull/119616/)
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`]
(https://github.com/rust-lang/rust/pull/122170/)
- [Add `arm64ec-pc-windows-msvc` tier 3 target]
(https://github.com/rust-lang/rust/pull/119199/)
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52]
(https://github.com/rust-lang/rust/pull/110482/)
- [Add `loongarch64-unknown-linux-musl` tier 3 target]
(https://github.com/rust-lang/rust/pull/121832/)
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- [Bump Unicode to version 15.1.0, regenerate tables]
(https://github.com/rust-lang/rust/pull/120777/)
- [Make align_offset, align_to well-behaved in all cases]
(https://github.com/rust-lang/rust/pull/121201/)
- [PartialEq, PartialOrd: document expectations for transitive chains]
(https://github.com/rust-lang/rust/pull/115386/)
- [Optimize away poison guards when std is built with panic=abort]
(https://github.com/rust-lang/rust/pull/100603/)
- [Replace pthread `RwLock` with custom implementation]
(https://github.com/rust-lang/rust/pull/110211/)
- [Implement unwind safety for Condvar on all platforms]
(https://github.com/rust-lang/rust/pull/121768/)
- [Add ASCII fast-path for `char::is_grapheme_extended`]
(https://github.com/rust-lang/rust/pull/121138/)
Stabilized APIs
---------------
- [`impl Read for &Stdin`]
(https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
- [Accept non `'static` lifetimes for several `std::error::Error`
related implementations] (https://github.com/rust-lang/rust/pull/113833/)
- [Make `impl<Fd: AsFd>` impl take `?Sized`]
(https://github.com/rust-lang/rust/pull/114655/)
- [`impl From<TryReserveError> for io::Error`]
(https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)
These APIs are now stable in const contexts:
- [`Barrier::new()`]
(https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)
Cargo
-----
- [Stabilize lockfile v4](https://github.com/rust-lang/cargo/pull/12852/)
- [Respect `rust-version` when generating lockfile]
(https://github.com/rust-lang/cargo/pull/12861/)
- [Control `--charset` via auto-detecting config value]
(https://github.com/rust-lang/cargo/pull/13337/)
- [Support `target.<triple>.rustdocflags` officially]
(https://github.com/rust-lang/cargo/pull/13197/)
- [Stabilize global cache data tracking]
(https://github.com/rust-lang/cargo/pull/13492/)
Misc
----
- [rustdoc: add `--test-builder-wrapper` arg to support wrappers
such as RUSTC_WRAPPER when building doctests]
(https://github.com/rust-lang/rust/pull/114651/)
Compatibility Notes
-------------------
- [Many unsafe precondition checks now run for user code with debug
assertions enabled] (https://github.com/rust-lang/rust/pull/120594/)
This change helps users catch undefined behavior in their code,
though the details of how much is checked are generally not
stable.
- [riscv only supports split_debuginfo=off for now]
(https://github.com/rust-lang/rust/pull/120518/)
- [Consistently check bounds on hidden types of `impl Trait`]
(https://github.com/rust-lang/rust/pull/121679)
- [Change equality of higher ranked types to not rely on subtyping]
(https://github.com/rust-lang/rust/pull/118247)
- [When called, additionally check bounds on normalized function return type]
(https://github.com/rust-lang/rust/pull/118882)
- [Expand coverage for `arithmetic_overflow` lint]
(https://github.com/rust-lang/rust/pull/119432/)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Update to LLVM 18](https://github.com/rust-lang/rust/pull/120055/)
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`]
(https://github.com/rust-lang/rust/pull/112267/)
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`]
(https://github.com/rust-lang/rust/pull/112268/)
- [Introduce `run-make` V2 infrastructure, a `run_make_support`
library and port over 2 tests as example]
(https://github.com/rust-lang/rust/pull/113026/)
- [Windows: Implement condvar, mutex and rwlock using futex]
(https://github.com/rust-lang/rust/pull/121956/)
Version 1.77.0 (2024-03-21)
==========================
- [Reveal opaque types within the defining body for exhaustiveness checking.]
(https://github.com/rust-lang/rust/pull/116821/)
- [Stabilize C-string literals.]
(https://github.com/rust-lang/rust/pull/117472/)
- [Stabilize THIR unsafeck.]
(https://github.com/rust-lang/rust/pull/117673/)
- [Add lint `static_mut_refs` to warn on references to mutable statics.]
(https://github.com/rust-lang/rust/pull/117556/)
- [Support async recursive calls (as long as they have indirection).]
(https://github.com/rust-lang/rust/pull/117703/)
- [Undeprecate lint `unstable_features` and make use of it in the compiler.]
(https://github.com/rust-lang/rust/pull/118639/)
- [Make inductive cycles in coherence ambiguous always.]
(https://github.com/rust-lang/rust/pull/118649/)
- [Get rid of type-driven traversal in const-eval interning]
(https://github.com/rust-lang/rust/pull/119044/),
only as a [future compatiblity lint]
(https://github.com/rust-lang/rust/pull/122204) for now.
- [Deny braced macro invocations in let-else.]
(https://github.com/rust-lang/rust/pull/119062/)
Compiler
--------
- [Include lint `soft_unstable` in future breakage reports.]
(https://github.com/rust-lang/rust/pull/116274/)
- [Make `i128` and `u128` 16-byte aligned on x86-based targets.]
(https://github.com/rust-lang/rust/pull/116672/)
- [Use `--verbose` in diagnostic output.]
(https://github.com/rust-lang/rust/pull/119129/)
- [Improve spacing between printed tokens.]
(https://github.com/rust-lang/rust/pull/120227/)
- [Merge the `unused_tuple_struct_fields` lint into `dead_code`.]
(https://github.com/rust-lang/rust/pull/118297/)
- [Error on incorrect implied bounds in well-formedness check]
(https://github.com/rust-lang/rust/pull/118553/),
with a temporary exception for Bevy.
- [Fix coverage instrumentation/reports for non-ASCII source code.]
(https://github.com/rust-lang/rust/pull/119033/)
- [Fix `fn`/`const` items implied bounds and well-formedness check.]
(https://github.com/rust-lang/rust/pull/120019/)
- [Promote `riscv32{im|imafc}-unknown-none-elf` targets to tier 2.]
(https://github.com/rust-lang/rust/pull/118704/)
- Add several new tier 3 targets:
- [`aarch64-unknown-illumos`]
(https://github.com/rust-lang/rust/pull/112936/)
- [`hexagon-unknown-none-elf`]
(https://github.com/rust-lang/rust/pull/117601/)
- [`riscv32imafc-esp-espidf`]
(https://github.com/rust-lang/rust/pull/119738/)
- [`riscv32im-risc0-zkvm-elf`]
(https://github.com/rust-lang/rust/pull/117958/)
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- [Implement `From<&[T; N]>` for `Cow<[T]>`.]
(https://github.com/rust-lang/rust/pull/113489/)
- [Remove special-case handling of `vec.split_off
(0)`.](https://github.com/rust-lang/rust/pull/119917/)
Stabilized APIs
---------------
- [`array::each_ref`]
(https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_ref)
- [`array::each_mut`]
(https://doc.rust-lang.org/stable/std/primitive.array.html#method.each_mut)
- [`core::net`]
(https://doc.rust-lang.org/stable/core/net/index.html)
- [`f32::round_ties_even`]
(https://doc.rust-lang.org/stable/std/primitive.f32.html#method.round_ties_even)
- [`f64::round_ties_even`]
(https://doc.rust-lang.org/stable/std/primitive.f64.html#method.round_ties_even)
- [`mem::offset_of!`]
(https://doc.rust-lang.org/stable/std/mem/macro.offset_of.html)
- [`slice::first_chunk`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk)
- [`slice::first_chunk_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first_chunk_mut)
- [`slice::split_first_chunk`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk)
- [`slice::split_first_chunk_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first_chunk_mut)
- [`slice::last_chunk`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk)
- [`slice::last_chunk_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last_chunk_mut)
- [`slice::split_last_chunk`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk)
- [`slice::split_last_chunk_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last_chunk_mut)
- [`slice::chunk_by`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by)
- [`slice::chunk_by_mut`]
(https://doc.rust-lang.org/stable/std/primitive.slice.html#method.chunk_by_mut)
- [`Bound::map`]
(https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.map)
- [`File::create_new`]
(https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.create_new)
- [`Mutex::clear_poison`]
(https://doc.rust-lang.org/stable/std/sync/struct.Mutex.html#method.clear_poison)
- [`RwLock::clear_poison`]
(https://doc.rust-lang.org/stable/std/sync/struct.RwLock.html#method.clear_poison)
Cargo
-----
- [Extend the build directive syntax with `cargo::`.]
(https://github.com/rust-lang/cargo/pull/12201/)
- [Stabilize metadata `id` format as `PackageIDSpec`.]
(https://github.com/rust-lang/cargo/pull/12914/)
- [Pull out as `cargo-util-schemas` as a crate.]
(https://github.com/rust-lang/cargo/pull/13178/)
- [Strip all debuginfo when debuginfo is not requested.]
(https://github.com/rust-lang/cargo/pull/13257/)
- [Inherit jobserver from env for all kinds of runners.]
(https://github.com/rust-lang/cargo/pull/12776/)
- [Deprecate rustc plugin support in cargo.]
(https://github.com/rust-lang/cargo/pull/13248/)
Rustdoc
-----
- [Allows links in markdown headings.]
(https://github.com/rust-lang/rust/pull/117662/)
- [Search for tuples and unit by type with `()`.]
(https://github.com/rust-lang/rust/pull/118194/)
- [Clean up the source sidebar's hide button.]
(https://github.com/rust-lang/rust/pull/119066/)
- [Prevent JS injection from `localStorage`.]
(https://github.com/rust-lang/rust/pull/120250/)
Misc
----
- [Recommend version-sorting for all sorting in style guide.]
(https://github.com/rust-lang/rust/pull/115046/)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Add more weirdness to `weird-exprs.rs`.]
(https://github.com/rust-lang/rust/pull/119028/)
rust: do-cross is standalone, so ${ECHO} is not defined.
Use echo again, contrary to pkglint's recommendation.
rust: update to 1.79 based on wip/rust179 rust179 was created by jperkin based on rust178 by he@, jperkin@, and adam@ Changes: 1.79 - Inline const expressions - Bounds in associated type position - Extending automatic temporary lifetime extension - Frame pointers enabled in standard library builds https://blog.rust-lang.org/2024/06/13/Rust-1.79.0.html 1.78 - Diagnostic attributes - Asserting unsafe preconditions - Deterministic realignment https://blog.rust-lang.org/2024/05/02/Rust-1.78.0.html 1.77.2 This release includes a fix for CVE-2024-24576. https://blog.rust-lang.org/2024/04/09/Rust-1.77.2.html 1.77.1 Windows-only fix https://blog.rust-lang.org/2024/03/28/Rust-1.77.1.html 1.77.0 - C-string literals - Support for recursion in async fn - offset_of! - Enable strip in release profiles by default https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html
lang/rust: update to 1.76.0
Language
- Document Rust ABI compatibility between various types
- Also: guarantee that char and u32 are ABI-compatible
- Add lint ambiguous_wide_pointer_comparisons that supersedes clippy::vtable_address_comparisons
Compiler
- Lint pinned #[must_use] pointers (in particular, Box<T> where T is #[must_use]) in unused_must_use.
- Soundness fix: fix computing the offset of an unsized field in a packed struct
- Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail
- Add $message_type field to distinguish json diagnostic outputs
- Enable Rust to use the EHCont security feature of Windows
- Add tier 3 {x86_64,i686}-win7-windows-msvc targets
- Add tier 3 aarch64-apple-watchos target
- Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets
Refer to Rust's platform support page for more information on Rust's tiered platform support.
Libraries
- Add a column number to dbg!()
- Add std::hash::{DefaultHasher, RandomState} exports
- Fix rounding issue with exponents in fmt
- Add T: ?Sized to RwLockReadGuard and RwLockWriteGuard's Debug impls.
- Windows: Allow File::create to work on hidden files
Stabilized APIs
- Arc::unwrap_or_clone
- Rc::unwrap_or_clone
- Result::inspect
- Result::inspect_err
- Option::inspect
- type_name_of_val
- std::hash::{DefaultHasher, RandomState} These were previously available only through std::collections::hash_map.
- ptr::{from_ref, from_mut}
- ptr::addr_eq
Cargo
See Cargo release notes.
Rustdoc
- Don't merge cfg and doc(cfg) attributes for re-exports
- rustdoc: allow resizing the sidebar / hiding the top bar
- rustdoc-search: add support for traits and associated types
- rustdoc: Add highlighting for comments in items declaration
Compatibility Notes
- Add allow-by-default lint for unit bindings This is expected to be upgraded to a warning by default in a future Rust release. Some macros emit bindings with type () with user-provided spans, which means that this lint will warn for user code.
- Remove x86_64-sun-solaris target.
- Remove asmjs-unknown-emscripten target
- Report errors in jobserver inherited through environment variables This may warn on benign problems too.
- Update the minimum external LLVM to 16.
- Improve print_tts This change can break some naive manual parsing of token trees in proc macro code which expect a particular structure after .to_string(), rather than just arbitrary Rust code.
- Make IMPLIED_BOUNDS_ENTAILMENT into a hard error from a lint
- Vec's allocation behavior was changed when collecting some iterators Allocation behavior is currently not specified, nevertheless changes can be surprising. See impl FromIterator for Vec for more details.
- Properly reject default on free const items
lang/rust: update to 1.72.1
Packaged in wip by he@ and adam@ with minor adjustments from myself.
v1.72.1
Changes
- Adjust codegen change to improve LLVM codegen
- rustdoc: Fix self ty params in objects with lifetimes
- Fix regression in compile times
- Resolve some ICE regressions in the compiler:
- #115215
- #115559
v1.72.0
Language
- Replace const eval limit by a lint and add an exponential backoff warning
- expand: Change how #![cfg(FALSE)] behaves on crate root
- Stabilize inline asm for LoongArch64
- Uplift clippy::undropped_manually_drops lint
- Uplift clippy::invalid_utf8_in_unchecked lint as invalid_from_utf8_unchecked
and invalid_from_utf8
- Uplift clippy::cast_ref_to_mut lint as invalid_reference_casting
- Uplift clippy::cmp_nan lint as invalid_nan_comparisons
- resolve: Remove artificial import ambiguity errors
- Don’t require associated types with Self: Sized bounds in dyn Trait objects
Compiler
- Remember names of cfg-ed out items to mention them in diagnostics
- Support for native WASM exceptions
- Add support for NetBSD/aarch64-be (big-endian arm64).
- Write to stdout if - is given as output file
- Force all native libraries to be statically linked when linking a static
binary
- Add Tier 3 support for loongarch64-unknown-none*
- Prevent .eh_frame from being emitted for -C panic=abort
- Support 128-bit enum variant in debuginfo codegen
- compiler: update solaris/illumos to enable tsan support.
Refer to Rust’s platform support page, platform-support-doc for more
information on Rust’s tiered platform support.
Libraries
- Document memory orderings of thread::{park, unpark}
- io: soften ‘at most one write attempt’ requirement in io::Write::write
- Specify behavior of HashSet::insert
- Relax implicit T: Sized bounds on BufReader<T>, BufWriter<T> and LineWriter<T>
- Update runtime guarantee for select_nth_unstable
- Return Ok on kill if process has already exited
- Implement PartialOrd for Vecs over different allocators
- Use 128 bits for TypeId hash
- Don’t drain-on-drop in DrainFilter impls of various collections.
- Make {Arc,Rc,Weak}::ptr_eq ignore pointer metadata
Rustdoc
- Allow whitespace as path separator like double colon
- Add search result item types after their name
- Search for slices and arrays by type with []
- Clean up type unification and “unboxing”
Stabilized APIs
impl<T: Send> Sync for mpsc::Sender<T>
impl TryFrom<&OsStr> for &str
String::leak
These APIs are now stable in const contexts:
CStr::from_bytes_with_nul
CStr::to_bytes
CStr::to_bytes_with_nul
CStr::to_str
Cargo
- Enable -Zdoctest-in-workspace by default. When running each documentation
test, the working directory is set to the root directory of the package the
test belongs to. docs #12221 #12288
- Add support of the “default” keyword to reset previously set build.jobs
parallelism back to the default. #12222
Compatibility Notes
- Alter Display for Ipv6Addr for IPv4-compatible addresses
- Cargo changed feature name validation check to a hard error. The warning was
added in Rust 1.49. These extended characters aren’t allowed on crates.io,
so this should only impact users of other registries, or people who don’t
publish to a registry. #12291
- Demoted mips*-unknown-linux-gnu* targets from host tier 2 to target tier 3 support.
rust: Upgrade to version 1.70.0.
Pkgsrc changes:
* Adjust patches and cargo checksums to new versions.
* Add support for NetBSD/riscv64.
Upstream changes:
Version 1.70.0 (2023-06-01)
==========================
Language
--------
- [Relax ordering rules for `asm!` operands]
(https://github.com/rust-lang/rust/pull/105798/)
- [Properly allow macro expanded `format_args` invocations to uses captures]
(https://github.com/rust-lang/rust/pull/106505/)
- [Lint ambiguous glob re-exports]
(https://github.com/rust-lang/rust/pull/107880/)
- [Perform const and unsafe checking for expressions in `let _ =
expr` position.]
(https://github.com/rust-lang/rust/pull/102256/)
Compiler
--------
- [Extend -Cdebuginfo with new options and named aliases]
(https://github.com/rust-lang/rust/pull/109808/)
This provides a smaller version of debuginfo for cases that only
need line number information (`-Cdebuginfo=line-tables-only`),
which may eventually become the default for `-Cdebuginfo=1`.
- [Make `unused_allocation` lint against `Box::new` too]
(https://github.com/rust-lang/rust/pull/104363/)
- [Detect uninhabited types early in const eval]
(https://github.com/rust-lang/rust/pull/109435/)
- [Switch to LLD as default linker for {arm,thumb}v4t-none-eabi]
(https://github.com/rust-lang/rust/pull/109721/)
- [Add tier 3 target `loongarch64-unknown-linux-gnu`]
(https://github.com/rust-lang/rust/pull/96971)
- [Add tier 3 target for `i586-pc-nto-qnx700`(QNX Neutrino RTOS, version 7.0)]
(https://github.com/rust-lang/rust/pull/109173/),
- [Insert alignment checks for pointer dereferences as debug assertions]
(https://github.com/rust-lang/rust/pull/98112)
This catches undefined behavior at runtime, and may cause existing
code to fail.
Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.
Libraries
---------
- [Document NonZeroXxx layout guarantees]
(https://github.com/rust-lang/rust/pull/94786/)
- [Windows: make `Command` prefer non-verbatim paths]
(https://github.com/rust-lang/rust/pull/96391/)
- [Implement Default for some alloc/core iterators]
(https://github.com/rust-lang/rust/pull/99929/)
- [Fix handling of trailing bare CR in str::lines]
(https://github.com/rust-lang/rust/pull/100311/)
- [allow negative numeric literals in `concat!`]
(https://github.com/rust-lang/rust/pull/106844/)
- [Add documentation about the memory layout of `Cell`]
(https://github.com/rust-lang/rust/pull/106921/)
- [Use `partial_cmp` to implement tuple `lt`/`le`/`ge`/`gt`]
(https://github.com/rust-lang/rust/pull/108157/)
- [Stabilize `atomic_as_ptr`]
(https://github.com/rust-lang/rust/pull/108419/)
- [Stabilize `nonnull_slice_from_raw_parts`]
(https://github.com/rust-lang/rust/pull/97506/)
- [Partial stabilization of `once_cell`]
(https://github.com/rust-lang/rust/pull/105587/)
- [Stabilize `nonzero_min_max`]
(https://github.com/rust-lang/rust/pull/106633/)
- [Flatten/inline format_args!() and (string and int) literal
arguments into format_args!()]
(https://github.com/rust-lang/rust/pull/106824/)
- [Stabilize movbe target feature]
(https://github.com/rust-lang/rust/pull/107711/)
- [don't splice from files into pipes in io::copy]
(https://github.com/rust-lang/rust/pull/108283/)
- [Add a builtin unstable `FnPtr` trait that is implemented for
all function pointers]
(https://github.com/rust-lang/rust/pull/108080/)
This extends `Debug`, `Pointer`, `Hash`, `PartialEq`, `Eq`,
`PartialOrd`, and `Ord` implementations for function pointers
with all ABIs.
Stabilized APIs
---------------
- [`NonZero*::MIN/MAX`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroI8.html#associatedconstant.MIN)
- [`BinaryHeap::retain`]
(https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.retain)
- [`Default for std::collections::binary_heap::IntoIter`]
(https://doc.rust-lang.org/stable/std/collections/binary_heap/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoIter, Iter, IterMut}`]
(https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoIter.html)
- [`Default for std::collections::btree_map::{IntoKeys, Keys}`]
(https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::{IntoValues, Values}`]
(https://doc.rust-lang.org/stable/std/collections/btree_map/struct.IntoKeys.html)
- [`Default for std::collections::btree_map::Range`]
(https://doc.rust-lang.org/stable/std/collections/btree_map/struct.Range.html)
- [`Default for std::collections::btree_set::{IntoIter, Iter}`]
(https://doc.rust-lang.org/stable/std/collections/btree_set/struct.IntoIter.html)
- [`Default for std::collections::btree_set::Range`]
(https://doc.rust-lang.org/stable/std/collections/btree_set/struct.Range.html)
- [`Default for std::collections::linked_list::{IntoIter, Iter, IterMut}`]
(https://doc.rust-lang.org/stable/alloc/collections/linked_list/struct.IntoIter.html)
- [`Default for std::vec::IntoIter`]
(https://doc.rust-lang.org/stable/alloc/vec/struct.IntoIter.html#impl-Default-for-IntoIter%3CT,+A%3E)
- [`Default for std::iter::Chain`]
(https://doc.rust-lang.org/stable/std/iter/struct.Chain.html)
- [`Default for std::iter::Cloned`]
(https://doc.rust-lang.org/stable/std/iter/struct.Cloned.html)
- [`Default for std::iter::Copied`]
(https://doc.rust-lang.org/stable/std/iter/struct.Copied.html)
- [`Default for std::iter::Enumerate`]
(https://doc.rust-lang.org/stable/std/iter/struct.Enumerate.html)
- [`Default for std::iter::Flatten`]
(https://doc.rust-lang.org/stable/std/iter/struct.Flatten.html)
- [`Default for std::iter::Fuse`]
(https://doc.rust-lang.org/stable/std/iter/struct.Fuse.html)
- [`Default for std::iter::Rev`]
(https://doc.rust-lang.org/stable/std/iter/struct.Rev.html)
- [`Default for std::slice::Iter`]
(https://doc.rust-lang.org/stable/std/slice/struct.Iter.html)
- [`Default for std::slice::IterMut`]
(https://doc.rust-lang.org/stable/std/slice/struct.IterMut.html)
- [`Rc::into_inner`]
(https://doc.rust-lang.org/stable/alloc/rc/struct.Rc.html#method.into_inner)
- [`Arc::into_inner`]
(https://doc.rust-lang.org/stable/alloc/sync/struct.Arc.html#method.into_inner)
- [`std::cell::OnceCell`]
(https://doc.rust-lang.org/stable/std/cell/struct.OnceCell.html)
- [`Option::is_some_and`]
(https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.is_some_and)
- [`NonNull::slice_from_raw_parts`]
(https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.slice_from_raw_parts)
- [`Result::is_ok_and`]
(https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_ok_and)
- [`Result::is_err_and`]
(https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.is_err_and)
- [`std::sync::atomic::Atomic*::as_ptr`]
(https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicU8.html#method.as_ptr)
- [`std::io::IsTerminal`]
(https://doc.rust-lang.org/stable/std/io/trait.IsTerminal.html)
- [`std::os::linux::net::SocketAddrExt`]
(https://doc.rust-lang.org/stable/std/os/linux/net/trait.SocketAddrExt.html)
- [`std::os::unix::net::UnixDatagram::bind_addr`]
(https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.bind_addr)
- [`std::os::unix::net::UnixDatagram::connect_addr`]
(https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.connect_addr)
- [`std::os::unix::net::UnixDatagram::send_to_addr`]
(https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixDatagram.html#method.send_to_addr)
- [`std::os::unix::net::UnixListener::bind_addr`]
(https://doc.rust-lang.org/stable/std/os/unix/net/struct.UnixListener.html#method.bind_addr)
- [`std::path::Path::as_mut_os_str`]
(https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.as_mut_os_str)
- [`std::sync::OnceLock`]
(https://doc.rust-lang.org/stable/std/sync/struct.OnceLock.html)
Cargo
-----
- [Add `CARGO_PKG_README`]
(https://github.com/rust-lang/cargo/pull/11645/)
- [Make `sparse` the default protocol for crates.io]
(https://github.com/rust-lang/cargo/pull/11791/)
- [Accurately show status when downgrading dependencies]
(https://github.com/rust-lang/cargo/pull/11839/)
- [Use registry.default for login/logout]
(https://github.com/rust-lang/cargo/pull/11949/)
- [Stabilize `cargo logout`]
(https://github.com/rust-lang/cargo/pull/11950/)
Misc
----
- [Stabilize rustdoc `--test-run-directory`]
(https://github.com/rust-lang/rust/pull/103682/)
Compatibility Notes
-------------------
- [Prevent stable `libtest` from supporting `-Zunstable-options`]
(https://github.com/rust-lang/rust/pull/109044/)
- [Perform const and unsafe checking for expressions in `let _ =
expr` position.]
(https://github.com/rust-lang/rust/pull/102256/)
- [WebAssembly targets enable `sign-ext` and `mutable-globals`
features in codegen]
(https://github.com/rust-lang/rust/issues/109807)
This may cause incompatibility with older execution environments.
- [Insert alignment checks for pointer dereferences as debug assertions]
(https://github.com/rust-lang/rust/pull/98112)
This catches undefined behavior at runtime, and may cause existing
code to fail.
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Upgrade to LLVM 16]
(https://github.com/rust-lang/rust/pull/109474/)
- [Use SipHash-1-3 instead of SipHash-2-4 for StableHasher]
(https://github.com/rust-lang/rust/pull/107925/)
rust: Upgrade to version 1.66.1.
Pkgsrc changes:
* pkglint cleanups, bump bootstrap kits to 1.65.0.
* New target: mipsel-unknown-netbsd, for cpu=mips32 with soft-float.
* Managed to retain the build of aarch64_be, llvm needed a patch to
avoid use of neon instructions in the BE case (llvm doesn't support
use of neon in BE mode). Ref. patch to
src/llvm-project/llvm/lib/Support/BLAKE3/blake3_impl.h.
Also submitted upstream of LLVM to the BLAKE3 maintainers.
* The minimum gcc version is now 7.x, and that includes the
cross-compiler for the targets. For i386 this also needs to
/usr/include/gcc-7 include files in the target root, because
immintrin.h from gcc 5 is not compatible with gcc 7.x. This
applies for the targets where we build against a root from netbsd-8
(sparc64, powerpc, i386), and files/gcc-wrap gets a hack for this.
* Pick up tweak for -latomic inclusion from
https://github.com/rust-lang/rust/issues/104220
and
https://github.com/rust-lang/rust/pull/104572
* Retain ability to do 32-bit NetBSD, by changing from 64 to 32 bit
types in library/std/src/sys/unix/thread_parker/netbsd.rs.
* I've tried to get the "openssl-src" build with -latomic where it's
needed. I've introduced the "NetBSD-generic32" system type and use
it for the NetBSD mipsel target. There is another attempt to do
the same in the patch to vendor/openssl-sys/build/main.rs.
Upstream changes:
Version 1.66.1 (2023-01-10)
===========================
- Added validation of SSH host keys for git URLs in Cargo
([CVE-2022-46176](https://www.cve.org/CVERecord?id=CVE-2022-46176))
Version 1.66.0 (2022-12-15)
===========================
Language
--------
- [Permit specifying explicit discriminants on all `repr(Int)`
enums](https://github.com/rust-lang/rust/pull/95710/)
```rust
#[repr(u8)]
enum Foo {
A(u8) = 0,
B(i8) = 1,
C(bool) = 42,
}
```
- [Allow transmutes between the same type differing only in
lifetimes](https://github.com/rust-lang/rust/pull/101520/)
- [Change constant evaluation errors from a deny-by-default lint to a
hard error](https://github.com/rust-lang/rust/pull/102091/)
- [Trigger `must_use` on `impl Trait` for
supertraits](https://github.com/rust-lang/rust/pull/102287/) This
makes `impl ExactSizeIterator` respect the existing `#[must_use]`
annotation on `Iterator`.
- [Allow `..X` and `..=X` in
patterns](https://github.com/rust-lang/rust/pull/102275/)
- [Uplift `clippy::for_loops_over_fallibles` lint into
rustc](https://github.com/rust-lang/rust/pull/99696/)
- [Stabilize `sym` operands in inline
assembly](https://github.com/rust-lang/rust/pull/103168/)
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101912/)
- [Opaque types no longer imply lifetime
bounds](https://github.com/rust-lang/rust/pull/95474/) This is a
soundness fix which may break code that was erroneously relying on this
behavior.
Compiler
--------
- [Add armv5te-none-eabi and thumbv5te-none-eabi tier 3
targets](https://github.com/rust-lang/rust/pull/101329/)
- Refer to Rust's [platform support page][platform-support-doc] for
more information on Rust's tiered platform support.
- [Add support for linking against macOS universal
libraries](https://github.com/rust-lang/rust/pull/98736)
Libraries
---------
- [Fix `#[derive(Default)]` on a generic `#[default]` enum adding
unnecessary `Default`
bounds](https://github.com/rust-lang/rust/pull/101040/)
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101821/)
Stabilized APIs
---------------
- [`proc_macro::Span::source_text`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.source_text)
- [`uX::{checked_add_signed, overflowing_add_signed,
saturating_add_signed,
wrapping_add_signed}`](https://doc.rust-lang.org/stable/std/primitive.u8.html#method.checked_add_signed)
- [`iX::{checked_add_unsigned, overflowing_add_unsigned,
saturating_add_unsigned,
wrapping_add_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_add_unsigned)
- [`iX::{checked_sub_unsigned, overflowing_sub_unsigned,
saturating_sub_unsigned,
wrapping_sub_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_sub_unsigned)
- [`BTreeSet::{first, last, pop_first,
pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.first)
- [`BTreeMap::{first_key_value, last_key_value, first_entry, last_entry,
pop_first,
pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.first_key_value)
- [Add `AsFd` implementations for stdio lock types on
WASI.](https://github.com/rust-lang/rust/pull/101768/)
- [`impl TryFrom<Vec<T>> for Box<[T;
N]>`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#impl-TryFrom%3CVec%3CT%2C%20Global%3E%3E-for-Box%3C%5BT%3B%20N%5D%2C%20Global%3E)
- [`core::hint::black_box`](https://doc.rust-lang.org/stable/std/hint/fn.black_box.html)
- [`Duration::try_from_secs_{f32,f64}`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.try_from_secs_f32)
- [`Option::unzip`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unzip)
- [`std::os::fd`](https://doc.rust-lang.org/stable/std/os/fd/index.html)
Rustdoc
-------
- [Add Rustdoc warning for invalid HTML tags in the
documentation](https://github.com/rust-lang/rust/pull/101720/)
Cargo
-----
- [Added `cargo remove` to remove dependencies from
Cargo.toml](https://doc.rust-lang.org/nightly/cargo/commands/cargo-remove.html)
- [`cargo publish` now waits for the new version to be downloadable
before exiting](https://github.com/rust-lang/cargo/pull/11062)
See [detailed release notes](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-166-2022-12-15) for more.
Compatibility Notes
-------------------
- [Only apply `ProceduralMasquerade` hack to older versions of
`rental`](https://github.com/rust-lang/rust/pull/94063/)
- [Don't export `__heap_base` and `__data_end` on
wasm32-wasi.](https://github.com/rust-lang/rust/pull/102385/)
- [Don't export `__wasm_init_memory` on
WebAssembly.](https://github.com/rust-lang/rust/pull/102426/)
- [Only export `__tls_*` on
wasm32-unknown-unknown.](https://github.com/rust-lang/rust/pull/102440/)
- [Don't link to `libresolv` in libstd on
Darwin](https://github.com/rust-lang/rust/pull/102766/)
- [Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in
`libiconv.dylib` on
Darwin)](https://github.com/rust-lang/rust/pull/103277/)
- [Opaque types no longer imply lifetime
bounds](https://github.com/rust-lang/rust/pull/95474/)
This is a soundness fix which may break code that was erroneously
relying on this behavior.
- [Make `order_dependent_trait_objects` show up in future-breakage
reports](https://github.com/rust-lang/rust/pull/102635/)
- [Change std::process::Command spawning to default to inheriting the
parent's signal mask](https://github.com/rust-lang/rust/pull/101077/)
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals of
rustc and related tools.
- [Enable BOLT for LLVM
compilation](https://github.com/rust-lang/rust/pull/94381/)
- [Enable LTO for
rustc_driver.so](https://github.com/rust-lang/rust/pull/101403/)
Version 1.65.0 (2022-11-03)
==========================
Language
--------
- [Error on `as` casts of enums with `#[non_exhaustive]` variants]
(https://github.com/rust-lang/rust/pull/92744/)
- [Stabilize `let else`](https://github.com/rust-lang/rust/pull/93628/)
- [Stabilize generic associated types (GATs)]
(https://github.com/rust-lang/rust/pull/96709/)
- [Add lints `let_underscore_drop`, `let_underscore_lock`, and
`let_underscore_must_use` from Clippy]
(https://github.com/rust-lang/rust/pull/97739/)
- [Stabilize `break`ing from arbitrary labeled blocks ("label-break-value")]
(https://github.com/rust-lang/rust/pull/99332/)
- [Uninitialized integers, floats, and raw pointers are now considered
immediate UB](https://github.com/rust-lang/rust/pull/98919/).
Usage of `MaybeUninit` is the correct way to work with uninitialized
memory.
- [Stabilize raw-dylib for Windows x86_64, aarch64, and thumbv7a]
(https://github.com/rust-lang/rust/pull/99916/)
- [Do not allow `Drop` impl on foreign ADTs]
(https://github.com/rust-lang/rust/pull/99576/)
Compiler
--------
- [Stabilize -Csplit-debuginfo on Linux]
(https://github.com/rust-lang/rust/pull/98051/)
- [Use niche-filling optimization even when multiple variants have
data] (https://github.com/rust-lang/rust/pull/94075/)
- [Associated type projections are now verified to be well-formed
prior to resolving the underlying type]
(https://github.com/rust-lang/rust/pull/99217/#issuecomment-1209365630)
- [Stringify non-shorthand visibility correctly]
(https://github.com/rust-lang/rust/pull/100350/)
- [Normalize struct field types when unsizing]
(https://github.com/rust-lang/rust/pull/101831/)
- [Update to LLVM 15](https://github.com/rust-lang/rust/pull/99464/)
- [Fix aarch64 call abi to correctly zeroext when needed]
(https://github.com/rust-lang/rust/pull/97800/)
- [debuginfo: Generalize C++-like encoding for enums]
(https://github.com/rust-lang/rust/pull/98393/)
- [Add `special_module_name` lint]
(https://github.com/rust-lang/rust/pull/94467/)
- [Add support for generating unique profraw files by default when
using `-C instrument-coverage`]
(https://github.com/rust-lang/rust/pull/100384/)
- [Allow dynamic linking for iOS/tvOS targets]
(https://github.com/rust-lang/rust/pull/100636/)
New targets:
- [Add armv4t-none-eabi as a tier 3 target]
(https://github.com/rust-lang/rust/pull/100244/)
- [Add powerpc64-unknown-openbsd and riscv64-unknown-openbsd as tier 3 targets]
(https://github.com/rust-lang/rust/pull/101025/)
- Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
Libraries
---------
- [Don't generate `PartialEq::ne` in derive(PartialEq)]
(https://github.com/rust-lang/rust/pull/98655/)
- [Windows RNG: Use `BCRYPT_RNG_ALG_HANDLE` by default]
(https://github.com/rust-lang/rust/pull/101325/)
- [Forbid mixing `System` with direct system allocator calls]
(https://github.com/rust-lang/rust/pull/101394/)
- [Document no support for writing to non-blocking stdio/stderr]
(https://github.com/rust-lang/rust/pull/101416/)
- [`std::layout::Layout` size must not overflow `isize::MAX` when
rounded up to `align`](https://github.com/rust-lang/rust/pull/95295)
This also changes the safety conditions on
`Layout::from_size_align_unchecked`.
Stabilized APIs
---------------
- [`std::backtrace::Backtrace`]
(https://doc.rust-lang.org/stable/std/backtrace/struct.Backtrace.html)
- [`Bound::as_ref`]
(https://doc.rust-lang.org/stable/std/ops/enum.Bound.html#method.as_ref)
- [`std::io::read_to_string`]
(https://doc.rust-lang.org/stable/std/io/fn.read_to_string.html)
- [`<*const T>::cast_mut`]
(https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.cast_mut)
- [`<*mut T>::cast_const`]
(https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.cast_const)
These APIs are now stable in const contexts:
- [`<*const T>::offset_from`]
(https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from)
- [`<*mut T>::offset_from`]
(https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.offset_from)
Cargo
-----
- [Apply GitHub fast path even for partial hashes]
(https://github.com/rust-lang/cargo/pull/10807/)
- [Do not add home bin path to PATH if it's already there]
(https://github.com/rust-lang/cargo/pull/11023/)
- [Take priority into account within the pending queue]
(https://github.com/rust-lang/cargo/pull/11032/).
This slightly optimizes job scheduling by Cargo, with typically
small improvements on larger crate graph builds.
Compatibility Notes
-------------------
- [`std::layout::Layout` size must not overflow `isize::MAX` when
rounded up to `align`] (https://github.com/rust-lang/rust/pull/95295).
This also changes the safety conditions on
`Layout::from_size_align_unchecked`.
- [`PollFn` now only implements `Unpin` if the closure is `Unpin`]
(https://github.com/rust-lang/rust/pull/102737).
This is a possible breaking change if users were relying on the
blanket unpin implementation. See discussion on the PR for
details of why this change was made.
- [Drop ExactSizeIterator impl from std::char::EscapeAscii]
(https://github.com/rust-lang/rust/pull/99880)
This is a backwards-incompatible change to the standard library's
surface area, but is unlikely to affect real world usage.
- [Do not consider a single repeated lifetime eligible for elision
in the return type] (https://github.com/rust-lang/rust/pull/103450)
This behavior was unintentionally changed in 1.64.0, and this
release reverts that change by making this an error again.
- [Reenable disabled early syntax gates as future-incompatibility
lints] (https://github.com/rust-lang/rust/pull/99935/)
- [Update the minimum external LLVM to 13]
(https://github.com/rust-lang/rust/pull/100460/)
- [Don't duplicate file descriptors into stdio fds]
(https://github.com/rust-lang/rust/pull/101426/)
- [Sunset RLS](https://github.com/rust-lang/rust/pull/100863/)
- [Deny usage of `#![cfg_attr(..., crate_type = ...)]` to set the
crate type] (https://github.com/rust-lang/rust/pull/99784/)
This strengthens the forward compatibility lint
deprecated_cfg_attr_crate_type_name to deny.
- [`llvm-has-rust-patches` allows setting the build system to treat
the LLVM as having Rust-specific patches]
(https://github.com/rust-lang/rust/pull/101072)
This option may need to be set for distributions that are building
Rust with a patched LLVM via `llvm-config`, not the built-in
LLVM.
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.
- [Add `x.sh` and `x.ps1` shell scripts]
(https://github.com/rust-lang/rust/pull/99992/)
- [compiletest: use target cfg instead of hard-coded tables]
(https://github.com/rust-lang/rust/pull/100260/)
- [Use object instead of LLVM for reading bitcode from rlibs]
(https://github.com/rust-lang/rust/pull/98100/)
- [Enable MIR inlining for optimized compilations]
(https://github.com/rust-lang/rust/pull/91743)
This provides a 3-10% improvement in compiletimes for real world
crates. See [perf results]
(https://perf.rust-lang.org/compare.html?start=aedf78e56b2279cc869962feac5153b6ba7001ed&end=0075bb4fad68e64b6d1be06bf2db366c30bc75e1&stat=instructions:u).
rust: update to version 1.64.0.
Pkgsrc changes:
* This package now contains rust-analyzer, so implicitly
conflicts with that pkgsrc package. The same goes for
the rust-src package.
* Add NetBSD/arm6 port
* Add unfinished NetBSD/mipsel port
* Revert the use of the internal LLVM,
should now build with the new pkgsrc LLVM (15).
* Add depndence on compat80 for sparc64 to fix the build
* Adapt patches
* Add CHECK_INTERPRETER_SKIP for a few (mostly unused) files.
(A proper fix may come later.)
Upstream changes:
Version 1.64.0 (2022-09-22)
===========================
Language
--------
- [Unions with mutable references or tuples of allowed types are
now allowed](https://github.com/rust-lang/rust/pull/97995/)
- It is now considered valid to deallocate memory pointed to by a
shared reference `&T` [if every byte in `T` is inside an
`UnsafeCell`](https://github.com/rust-lang/rust/pull/98017/)
- Unused tuple struct fields are now warned against in an
allow-by-default lint, [`unused_tuple_struct_fields`]
(https://github.com/rust-lang/rust/pull/95977/), similar to the
existing warning for unused struct fields. This lint will become
warn-by-default in the future.
Compiler
--------
- [Add Nintendo Switch as tier 3 target]
(https://github.com/rust-lang/rust/pull/88991/)
- Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
- [Only compile `#[used]` as llvm.compiler.used for ELF targets]
(https://github.com/rust-lang/rust/pull/93718/)
- [Add the `--diagnostic-width` compiler flag to define the terminal width.]
(https://github.com/rust-lang/rust/pull/95635/)
- [Add support for link-flavor `rust-lld` for iOS, tvOS and watchOS]
(https://github.com/rust-lang/rust/pull/98771/)
Libraries
---------
- [Remove restrictions on compare-exchange memory ordering.]
(https://github.com/rust-lang/rust/pull/98383/)
- You can now `write!` or `writeln!` into an `OsString`: [Implement
`fmt::Write` for `OsString`](https://github.com/rust-lang/rust/pull/97915/)
- [Make RwLockReadGuard covariant]
(https://github.com/rust-lang/rust/pull/96820/)
- [Implement `FusedIterator` for `std::net::[Into]Incoming`]
(https://github.com/rust-lang/rust/pull/97300/)
- [`impl<T: AsRawFd> AsRawFd for {Arc,Box}<T>`]
(https://github.com/rust-lang/rust/pull/97437/)
- [`ptr::copy` and `ptr::swap` are doing untyped copies]
(https://github.com/rust-lang/rust/pull/97712/)
- [Add cgroupv1 support to `available_parallelism`]
(https://github.com/rust-lang/rust/pull/97925/)
- [Mitigate many incorrect uses of `mem::uninitialized`]
(https://github.com/rust-lang/rust/pull/99182/)
Stabilized APIs
---------------
- [`future::IntoFuture`]
(https://doc.rust-lang.org/stable/std/future/trait.IntoFuture.html)
- [`future::poll_fn`]
(https://doc.rust-lang.org/stable/std/future/fn.poll_fn.html)
- [`task::ready!`]
(https://doc.rust-lang.org/stable/std/task/macro.ready.html)
- [`num::NonZero*::checked_mul`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.checked_mul)
- [`num::NonZero*::checked_pow`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.checked_pow)
- [`num::NonZero*::saturating_mul`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.saturating_mul)
- [`num::NonZero*::saturating_pow`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.saturating_pow)
- [`num::NonZeroI*::abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.abs)
- [`num::NonZeroI*::checked_abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.checked_abs)
- [`num::NonZeroI*::overflowing_abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.overflowing_abs)
- [`num::NonZeroI*::saturating_abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.saturating_abs)
- [`num::NonZeroI*::unsigned_abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.unsigned_abs)
- [`num::NonZeroI*::wrapping_abs`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroIsize.html#method.wrapping_abs)
- [`num::NonZeroU*::checked_add`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.checked_add)
- [`num::NonZeroU*::checked_next_power_of_two`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.checked_next_power_of_two)
- [`num::NonZeroU*::saturating_add`]
(https://doc.rust-lang.org/stable/std/num/struct.NonZeroUsize.html#method.saturating_add)
- [`os::unix::process::CommandExt::process_group`]
(https://doc.rust-lang.org/stable/std/os/unix/process/trait.CommandExt.html#tymethod.process_group)
- [`os::windows::fs::FileTypeExt::is_symlink_dir`]
(https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTypeExt.html#tymethod.is_symlink_dir)
- [`os::windows::fs::FileTypeExt::is_symlink_file`]
(https://doc.rust-lang.org/stable/std/os/windows/fs/trait.FileTypeExt.html#tymethod.is_symlink_file)
These types were previously stable in `std::ffi`, but are now also
available in `core` and `alloc`:
- [`core::ffi::CStr`]
(https://doc.rust-lang.org/stable/core/ffi/struct.CStr.html)
- [`core::ffi::FromBytesWithNulError`]
(https://doc.rust-lang.org/stable/core/ffi/struct.FromBytesWithNulError.html)
- [`alloc::ffi::CString`]
(https://doc.rust-lang.org/stable/alloc/ffi/struct.CString.html)
- [`alloc::ffi::FromVecWithNulError`]
(https://doc.rust-lang.org/stable/alloc/ffi/struct.FromVecWithNulError.html)
- [`alloc::ffi::IntoStringError`]
(https://doc.rust-lang.org/stable/alloc/ffi/struct.IntoStringError.html)
- [`alloc::ffi::NulError`]
(https://doc.rust-lang.org/stable/alloc/ffi/struct.NulError.html)
These types were previously stable in `std::os::raw`, but are now
also available in `core::ffi` and `std::ffi`:
- [`ffi::c_char`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_char.html)
- [`ffi::c_double`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_double.html)
- [`ffi::c_float`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_float.html)
- [`ffi::c_int`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_int.html)
- [`ffi::c_long`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_long.html)
- [`ffi::c_longlong`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_longlong.html)
- [`ffi::c_schar`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_schar.html)
- [`ffi::c_short`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_short.html)
- [`ffi::c_uchar`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_uchar.html)
- [`ffi::c_uint`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_uint.html)
- [`ffi::c_ulong`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_ulong.html)
- [`ffi::c_ulonglong`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_ulonglong.html)
- [`ffi::c_ushort`]
(https://doc.rust-lang.org/stable/std/ffi/type.c_ushort.html)
These APIs are now usable in const contexts:
- [`slice::from_raw_parts`]
(https://doc.rust-lang.org/stable/core/slice/fn.from_raw_parts.html)
Cargo
-----
- [Packages can now inherit settings from the workspace so that
the settings can be centralized in one place.]
(https://github.com/rust-lang/cargo/pull/10859) See
[`workspace.package`](https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-workspacepackage-table)
and
[`workspace.dependencies`](https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html#the-workspacedependencies-table)
for more details on how to define these common settings.
- [Cargo commands can now accept multiple `--target` flags to build
for multiple targets at once]
(https://github.com/rust-lang/cargo/pull/10766), and the
[`build.target`](https://doc.rust-lang.org/nightly/cargo/reference/config.html#buildtarget)
config option may now take an array of multiple targets.
- [The `--jobs` argument can now take a negative number to count
backwards from the max CPUs.]
(https://github.com/rust-lang/cargo/pull/10844)
- [`cargo add` will now update `Cargo.lock`.]
(https://github.com/rust-lang/cargo/pull/10902)
- [Added](https://github.com/rust-lang/cargo/pull/10838) the
[`--crate-type`](https://doc.rust-lang.org/nightly/cargo/commands/cargo-rustc.html#option-cargo-rustc---crate-type)
flag to `cargo rustc` to override the crate type.
- [Significantly improved the performance fetching git dependencies from GitHub
when using a hash in the `rev` field.]
(https://github.com/rust-lang/cargo/pull/10079)
Misc
----
- [The `rust-analyzer` rustup component is now available on the stable channel.]
(https://github.com/rust-lang/rust/pull/98640/)
Compatibility Notes
-------------------
- The minimum required versions for all `-linux-gnu` targets are
now at least kernel 3.2 and glibc 2.17, for targets that previously
supported older versions: [Increase the minimum linux-gnu
versions](https://github.com/rust-lang/rust/pull/95026/)
- [Network primitives are now implemented with the ideal Rust
layout, not the C system layout]
(https://github.com/rust-lang/rust/pull/78802/). This can
cause problems when transmuting the types.
- [Add assertion that `transmute_copy`'s `U` is not larger than `T`]
(https://github.com/rust-lang/rust/pull/98839/)
- [A soundness bug in `BTreeMap` was fixed]
(https://github.com/rust-lang/rust/pull/99413/) that allowed data
it was borrowing to be dropped before the container.
- [The Drop behavior of C-like enums cast to ints has changed]
(https://github.com/rust-lang/rust/pull/96862/). These are already
discouraged by a compiler warning.
- [Relate late-bound closure lifetimes to parent fn in NLL]
(https://github.com/rust-lang/rust/pull/98835/)
- [Errors at const-eval time are now in future incompatibility reports]
(https://github.com/rust-lang/rust/pull/97743/)
- On the `thumbv6m-none-eabi` target, some incorrect `asm!` statements
were erroneously accepted if they used the high registers (r8 to
r14) as an input/output operand. [This is no longer accepted]
(https://github.com/rust-lang/rust/pull/99155/).
- [`impl Trait` was accidentally accepted as the associated type
value of return-position `impl Trait`]
(https://github.com/rust-lang/rust/pull/97346/), without
fulfilling all the trait bounds of that associated type, as long
as the hidden type satisfies said bounds. This has been fixed.
Internal Changes
----------------
These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals
of rustc and related tools.
- Windows builds now use profile-guided optimization, providing
10-20% improvements to compiler performance: [Utilize PGO for
windows x64 rustc dist builds]
(https://github.com/rust-lang/rust/pull/96978/)
- [Stop keeping metadata in memory before writing it to disk]
(https://github.com/rust-lang/rust/pull/96544/)
- [compiletest: strip debuginfo by default for mode=ui]
(https://github.com/rust-lang/rust/pull/98140/)
- Many improvements to generated code for derives, including
performance improvements:
- [Don't use match-destructuring for derived ops on structs.]
(https://github.com/rust-lang/rust/pull/98446/)
- [Many small deriving cleanups]
(https://github.com/rust-lang/rust/pull/98741/)
- [More derive output improvements]
(https://github.com/rust-lang/rust/pull/98758/)
- [Clarify deriving code](https://github.com/rust-lang/rust/pull/98915/)
- [Final derive output improvements]
(https://github.com/rust-lang/rust/pull/99046/)
- [Stop injecting `#[allow(unused_qualifications)]` in generated
`derive` implementations](https://github.com/rust-lang/rust/pull/99485/)
- [Improve `derive(Debug)`](https://github.com/rust-lang/rust/pull/98190/)
- [Bump to clap 3](https://github.com/rust-lang/rust/pull/98213/)
- [fully move dropck to mir](https://github.com/rust-lang/rust/pull/98641/)
- [Optimize `Vec::insert` for the case where `index == len`.]
(https://github.com/rust-lang/rust/pull/98755/)
- [Convert rust-analyzer to an in-tree tool]
(https://github.com/rust-lang/rust/pull/99603/)
lang/rust: add bits required to build armv6 bootstrap kits.
rust: Cleanups and fixes from wip. No effective functional change to normal builds, primarily whitespace changes, but does include a fix to the stage0-bootstrap target.
lang/rust: update to version 1.60.0.
Pkgsrc changes:
* Bump available bootstraps to 1.59.0.
* Adjust line number in patches which had non-zero offsets.
Upstream changes:
Version 1.60.0 (2022-04-07)
===========================
Language
--------
- [Stabilize `#[cfg(panic = "...")]` for either `"unwind"` or `"abort"`.]
[93658]
- [Stabilize `#[cfg(target_has_atomic = "...")]` for each integer
size and `"ptr"`.][93824]
Compiler
--------
- [Enable combining `+crt-static` and `relocation-model=pic` on
`x86_64-unknown-linux-gnu`][86374]
- [Fixes wrong `unreachable_pub` lints on nested and glob public
reexport][87487]
- [Stabilize `-Z instrument-coverage` as `-C instrument-coverage`][90132]
- [Stabilize `-Z print-link-args` as `--print link-args`][91606]
- [Add new Tier 3 target `mips64-openwrt-linux-musl`\*][92300]
- [Add new Tier 3 target `armv7-unknown-linux-uclibceabi` (softfloat)\*][92383]
- [Fix invalid removal of newlines from doc comments][92357]
- [Add kernel target for RustyHermit][92670]
- [Deny mixing bin crate type with lib crate types][92933]
- [Make rustc use `RUST_BACKTRACE=full` by default][93566]
- [Upgrade to LLVM 14][93577]
\* Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
Libraries
---------
- [Guarantee call order for `sort_by_cached_key`][89621]
- [Improve `Duration::try_from_secs_f32`/`f64` accuracy by directly
processing exponent and mantissa][90247]
- [Make `Instant::{duration_since, elapsed, sub}` saturating][89926]
- [Remove non-monotonic clocks workarounds in `Instant::now`][89926]
- [Make `BuildHasherDefault`, `iter::Empty` and `future::Pending`
covariant][92630]
Stabilized APIs
---------------
- [`Arc::new_cyclic`][arc_new_cyclic]
- [`Rc::new_cyclic`][rc_new_cyclic]
- [`slice::EscapeAscii`][slice_escape_ascii]
- [`<[u8]>::escape_ascii`][slice_u8_escape_ascii]
- [`u8::escape_ascii`][u8_escape_ascii]
- [`Vec::spare_capacity_mut`][vec_spare_capacity_mut]
- [`MaybeUninit::assume_init_drop`][assume_init_drop]
- [`MaybeUninit::assume_init_read`][assume_init_read]
- [`i8::abs_diff`][i8_abs_diff]
- [`i16::abs_diff`][i16_abs_diff]
- [`i32::abs_diff`][i32_abs_diff]
- [`i64::abs_diff`][i64_abs_diff]
- [`i128::abs_diff`][i128_abs_diff]
- [`isize::abs_diff`][isize_abs_diff]
- [`u8::abs_diff`][u8_abs_diff]
- [`u16::abs_diff`][u16_abs_diff]
- [`u32::abs_diff`][u32_abs_diff]
- [`u64::abs_diff`][u64_abs_diff]
- [`u128::abs_diff`][u128_abs_diff]
- [`usize::abs_diff`][usize_abs_diff]
- [`Display for io::ErrorKind`][display_error_kind]
- [`From<u8> for ExitCode`][from_u8_exit_code]
- [`Not for !` (the "never" type)][not_never]
- [_Op_`Assign<$t> for Wrapping<$t>`][wrapping_assign_ops]
- [`arch::is_aarch64_feature_detected!`][is_aarch64_feature_detected]
Cargo
-----
- [Port cargo from `toml-rs` to `toml_edit`][cargo/10086]
- [Stabilize `-Ztimings` as `--timings`][cargo/10245]
- [Stabilize namespaced and weak dependency features.][cargo/10269]
- [Accept more `cargo:rustc-link-arg-*` types from build script
output.][cargo/10274]
- [cargo-new should not add ignore rule on Cargo.lock inside
subdirs][cargo/10379]
Misc
----
- [Ship docs on Tier 2 platforms by reusing the closest Tier 1
platform docs][92800]
- [Drop rustc-docs from complete profile][93742]
- [bootstrap: tidy up flag handling for llvm build][93918]
Compatibility Notes
-------------------
- [Remove compiler-rt linking hack on Android][83822]
- [Mitigations for platforms with non-monotonic clocks have been removed from
`Instant::now`][89926]. On platforms that don't provide monotonic clocks, an
instant is not guaranteed to be greater than an earlier instant anymore.
- [`Instant::{duration_since, elapsed, sub}` do not panic anymore on underflow,
saturating to `0` instead][89926]. In the real world the panic happened mostly
on platforms with buggy monotonic clock implementations rather than catching
programming errors like reversing the start and end times. Such programming
errors will now results in `0` rather than a panic.
- In a future release we're planning to increase the baseline requirements for
the Linux kernel to version 3.2, and for glibc to version 2.17. We'd love
your feedback in [PR #95026][95026].
Internal Changes
----------------
These changes provide no direct user facing benefits, but represent
significant improvements to the internals and overall performance
of rustc and related tools.
- [Switch all libraries to the 2021 edition][92068]
[83822]: https://github.com/rust-lang/rust/pull/83822
[86374]: https://github.com/rust-lang/rust/pull/86374
[87487]: https://github.com/rust-lang/rust/pull/87487
[89621]: https://github.com/rust-lang/rust/pull/89621
[89926]: https://github.com/rust-lang/rust/pull/89926
[90132]: https://github.com/rust-lang/rust/pull/90132
[90247]: https://github.com/rust-lang/rust/pull/90247
[91606]: https://github.com/rust-lang/rust/pull/91606
[92068]: https://github.com/rust-lang/rust/pull/92068
[92300]: https://github.com/rust-lang/rust/pull/92300
[92357]: https://github.com/rust-lang/rust/pull/92357
[92383]: https://github.com/rust-lang/rust/pull/92383
[92630]: https://github.com/rust-lang/rust/pull/92630
[92670]: https://github.com/rust-lang/rust/pull/92670
[92800]: https://github.com/rust-lang/rust/pull/92800
[92933]: https://github.com/rust-lang/rust/pull/92933
[93566]: https://github.com/rust-lang/rust/pull/93566
[93577]: https://github.com/rust-lang/rust/pull/93577
[93658]: https://github.com/rust-lang/rust/pull/93658
[93742]: https://github.com/rust-lang/rust/pull/93742
[93824]: https://github.com/rust-lang/rust/pull/93824
[93918]: https://github.com/rust-lang/rust/pull/93918
[95026]: https://github.com/rust-lang/rust/pull/95026
[cargo/10086]: https://github.com/rust-lang/cargo/pull/10086
[cargo/10245]: https://github.com/rust-lang/cargo/pull/10245
[cargo/10269]: https://github.com/rust-lang/cargo/pull/10269
[cargo/10274]: https://github.com/rust-lang/cargo/pull/10274
[cargo/10379]: https://github.com/rust-lang/cargo/pull/10379
[arc_new_cyclic]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_cyclic
[rc_new_cyclic]: https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_cyclic
[slice_escape_ascii]: https://doc.rust-lang.org/stable/std/slice/struct.EscapeAscii.html
[slice_u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.escape_ascii
[u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.escape_ascii
[vec_spare_capacity_mut]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.spare_capacity_mut
[assume_init_drop]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_drop
[assume_init_read]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_read
[i8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.abs_diff
[i16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.abs_diff
[i32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.abs_diff
[i64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.abs_diff
[i128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.abs_diff
[isize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.abs_diff
[u8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.abs_diff
[u16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.abs_diff
[u32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.abs_diff
[u64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.abs_diff
[u128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.abs_diff
[usize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.abs_diff
[display_error_kind]: https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#impl-Display
[from_u8_exit_code]: https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html#impl-From%3Cu8%3E
[not_never]: https://doc.rust-lang.org/stable/std/primitive.never.html#impl-Not
[wrapping_assign_ops]: https://doc.rust-lang.org/stable/std/num/struct.Wrapping.html#trait-implementations
[is_aarch64_feature_detected]: https://doc.rust-lang.org/stable/std/arch/macro.is_aarch64_feature_detected.html
Update lang/rust to version 1.58.1.
Pkgsrc changes:
* Bump bootstrap kit version to 1.57.0.
* Bump require external LLVM to 12.0, according to upstream change log.
* Adjust patches as needed, adjust line numbers.
* Update checksum adjustments. For some reason the vendor/libc checksum
doesn't need fixing, apparently, it remains as commented out.
* Add makefile to do all the NetBSD boostrap/cross builds (do-cross.mk).
Allow passing in additions to CONFIGURE_ARGS via ADD_CONFIGURE_ARGS.
Upstream changes:
Version 1.58.1 (2022-01-19)
===========================
* Fix race condition in `std::fs::remove_dir_all` ([CVE-2022-21658])
* [Handle captured arguments in the `useless_format` Clippy lint][clippy/8295]
* [Move `non_send_fields_in_send_ty` Clippy lint to nursery][clippy/8075]
* [Fix wrong error message displayed when some imports are missing][91254]
* [Fix rustfmt not formatting generated files from stdin][92912]
[CVE-2022-21658]: https://www.cve.org/CVERecord?id=CVE-2022-21658]
[91254]: https://github.com/rust-lang/rust/pull/91254
[92912]: https://github.com/rust-lang/rust/pull/92912
[clippy/8075]: https://github.com/rust-lang/rust-clippy/pull/8075
[clippy/8295]: https://github.com/rust-lang/rust-clippy/pull/8295
Version 1.58.0 (2022-01-13)
==========================
Language
--------
- [Format strings can now capture arguments simply by writing
`{ident}` in the string.][90473] This works in all macros accepting
format strings. Support for this in `panic!` (`panic!("{ident}")`)
requires the 2021 edition; panic invocations in previous editions
that appear to be trying to use this will result in a warning lint
about not having the intended effect.
- [`*const T` pointers can now be dereferenced in const contexts.][89551]
- [The rules for when a generic struct implements `Unsize` have
been relaxed.][90417]
Compiler
--------
- [Add LLVM CFI support to the Rust compiler][89652]
- [Stabilize -Z strip as -C strip][90058]. Note that while release
builds already don't add debug symbols for the code you compile,
the compiled standard library that ships with Rust includes debug
symbols, so you may want to use the `strip` option to remove these
symbols to produce smaller release binaries. Note that this release
only includes support in rustc, not directly in cargo.
- [Add support for LLVM coverage mapping format versions 5 and 6][91207]
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
- [Update the minimum external LLVM to 12][90175]
- [Add `x86_64-unknown-none` at Tier 3*][89062]
- [Build musl dist artifacts with debuginfo enabled][90733]. When
building release binaries using musl, you may want to use the newly
stabilized strip option to remove these debug symbols, reducing
the size of your binaries.
- [Don't abort compilation after giving a lint error][87337]
- [Error messages point at the source of trait bound obligations
in more places][89580]
\* Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
Libraries
---------
- [All remaining functions in the standard library have `#[must_use]`
annotations where appropriate][89692], producing a warning when
ignoring their return value. This helps catch mistakes such as
expecting a function to mutate a value in place rather than return
a new value.
- [Paths are automatically canonicalized on Windows for operations
that support it][89174]
- [Re-enable debug checks for `copy` and `copy_nonoverlapping`][90041]
- [Implement `RefUnwindSafe` for `Rc<T>`][87467]
- [Make RSplit<T, P>: Clone not require T: Clone][90117]
- [Implement `Termination` for `Result<Infallible, E>`][88601].
This allows writing `fn main() -> Result<Infallible, ErrorType>`,
for a program whose successful exits never involve returning from
`main` (for instance, a program that calls `exit`, or that uses
`exec` to run another program).
Stabilized APIs
---------------
- [`Metadata::is_symlink`]
- [`Path::is_symlink`]
- [`{integer}::saturating_div`]
- [`Option::unwrap_unchecked`]
- [`Result::unwrap_unchecked`]
- [`Result::unwrap_err_unchecked`]
- [`NonZero{unsigned}::is_power_of_two`]
- [`File::options`]
These APIs are now usable in const contexts:
- [`Duration::new`]
- [`Duration::checked_add`]
- [`Duration::saturating_add`]
- [`Duration::checked_sub`]
- [`Duration::saturating_sub`]
- [`Duration::checked_mul`]
- [`Duration::saturating_mul`]
- [`Duration::checked_div`]
- [`MaybeUninit::as_ptr`]
- [`MaybeUninit::as_mut_ptr`]
- [`MaybeUninit::assume_init`]
- [`MaybeUninit::assume_init_ref`]
Cargo
-----
- [Add --message-format for install command][cargo/10107]
- [Warn when alias shadows external subcommand][cargo/10082]
Rustdoc
-------
- [Show all Deref implementations recursively in rustdoc][90183]
- [Use computed visibility in rustdoc][88447]
Compatibility Notes
-------------------
- [Try all stable method candidates first before trying unstable
ones][90329]. This change ensures that adding new nightly-only
methods to the Rust standard library will not break code invoking
methods of the same name from traits outside the standard library.
- Windows: [`std::process::Command` will no longer search the
current directory for executables.][87704]
- [All proc-macro backward-compatibility lints are now deny-by-default.][88041]
- [proc_macro: Append .0 to unsuffixed float if it would otherwise
become int token][90297]
- [Refactor weak symbols in std::sys::unix][90846]. This optimizes
accesses to glibc functions, by avoiding the use of dlopen. This
does not increase the [minimum expected version of
glibc](https://doc.rust-lang.org/nightly/rustc/platform-support.html).
However, software distributions that use symbol versions to detect
library dependencies, and which take weak symbols into account in
that analysis, may detect rust binaries as requiring newer versions
of glibc.
- [rustdoc now rejects some unexpected semicolons in doctests][91026]
Internal Changes
----------------
These changes provide no direct user facing benefits, but represent
significant improvements to the internals and overall performance
of rustc and related tools.
- [Implement coherence checks for negative trait impls][90104]
- [Add rustc lint, warning when iterating over hashmaps][89558]
- [Optimize live point computation][90491]
- [Enable verification for 1/32nd of queries loaded from disk][90361]
- [Implement version of normalize_erasing_regions that allows for
normalization failure][91255]
[87337]: https://github.com/rust-lang/rust/pull/87337/
[87467]: https://github.com/rust-lang/rust/pull/87467/
[87704]: https://github.com/rust-lang/rust/pull/87704/
[88041]: https://github.com/rust-lang/rust/pull/88041/
[88300]: https://github.com/rust-lang/rust/pull/88300/
[88447]: https://github.com/rust-lang/rust/pull/88447/
[88601]: https://github.com/rust-lang/rust/pull/88601/
[88624]: https://github.com/rust-lang/rust/pull/88624/
[89062]: https://github.com/rust-lang/rust/pull/89062/
[89174]: https://github.com/rust-lang/rust/pull/89174/
[89542]: https://github.com/rust-lang/rust/pull/89542/
[89551]: https://github.com/rust-lang/rust/pull/89551/
[89558]: https://github.com/rust-lang/rust/pull/89558/
[89580]: https://github.com/rust-lang/rust/pull/89580/
[89652]: https://github.com/rust-lang/rust/pull/89652/
[89677]: https://github.com/rust-lang/rust/pull/89677/
[89951]: https://github.com/rust-lang/rust/pull/89951/
[90041]: https://github.com/rust-lang/rust/pull/90041/
[90058]: https://github.com/rust-lang/rust/pull/90058/
[90104]: https://github.com/rust-lang/rust/pull/90104/
[90117]: https://github.com/rust-lang/rust/pull/90117/
[90175]: https://github.com/rust-lang/rust/pull/90175/
[90183]: https://github.com/rust-lang/rust/pull/90183/
[90297]: https://github.com/rust-lang/rust/pull/90297/
[90329]: https://github.com/rust-lang/rust/pull/90329/
[90361]: https://github.com/rust-lang/rust/pull/90361/
[90417]: https://github.com/rust-lang/rust/pull/90417/
[90473]: https://github.com/rust-lang/rust/pull/90473/
[90491]: https://github.com/rust-lang/rust/pull/90491/
[90733]: https://github.com/rust-lang/rust/pull/90733/
[90833]: https://github.com/rust-lang/rust/pull/90833/
[90846]: https://github.com/rust-lang/rust/pull/90846/
[90896]: https://github.com/rust-lang/rust/pull/90896/
[91026]: https://github.com/rust-lang/rust/pull/91026/
[91207]: https://github.com/rust-lang/rust/pull/91207/
[91255]: https://github.com/rust-lang/rust/pull/91255/
[91301]: https://github.com/rust-lang/rust/pull/91301/
[cargo/10082]: https://github.com/rust-lang/cargo/pull/10082/
[cargo/10107]: https://github.com/rust-lang/cargo/pull/10107/
[`Metadata::is_symlink`]: https://doc.rust-lang.org/stable/std/fs/struct.Metadata.html#method.is_symlink
[`Path::is_symlink`]: https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_symlink
[`{integer}::saturating_div`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.saturating_div
[`Option::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unwrap_unchecked
[`Result::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_unchecked
[`Result::unwrap_err_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_err_unchecked
[`NonZero{unsigned}::is_power_of_two`]: https://doc.rust-lang.org/stable/std/num/struct.NonZeroU8.html#method.is_power_of_two
[`File::options`]: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.options
[`unix::process::ExitStatusExt::core_dumped`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.core_dumped
[`unix::process::ExitStatusExt::stopped_signal`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.stopped_signal
[`unix::process::ExitStatusExt::continued`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.continued
[`unix::process::ExitStatusExt::into_raw`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.into_raw
[`Duration::new`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.new
[`Duration::checked_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_add
[`Duration::saturating_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_add
[`Duration::checked_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_sub
[`Duration::saturating_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_sub
[`Duration::checked_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_mul
[`Duration::saturating_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_mul
[`Duration::checked_div`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_div
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f64
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f32
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f64
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f32
[`Duration::mul_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f64
[`Duration::mul_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f32
[`Duration::div_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f64
[`Duration::div_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f32
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f64
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f32
[`MaybeUninit::as_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
[`MaybeUninit::as_mut_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_mut_ptr
[`MaybeUninit::assume_init`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
[`MaybeUninit::assume_init_ref`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref