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/)
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.
Update lang/rust to version 1.52.1. Pkgsrc changes: * Bump bootstrap kit version to 1.51.0. * Adjust patches as needed. * Update checksum adjustments. * Fix syntax error in commands adjusting libserde_derive for Darwin Upstream changes: Version 1.52.1 (2021-05-10) ============================ This release disables incremental compilation, unless the user has explicitly opted in via the newly added RUSTC_FORCE_INCREMENTAL=1 environment variable. This is due to the widespread, and frequently occuring, breakage encountered by Rust users due to newly enabled incremental verification in 1.52.0. Notably, Rust users **should** upgrade to 1.52.0 or 1.52.1: the bugs that are detected by newly added incremental verification are still present in past stable versions, and are not yet fixed on any channel. These bugs can lead to miscompilation of Rust binaries. These problems only affect incremental builds, so release builds with Cargo should not be affected unless the user has explicitly opted into incremental. Debug and check builds are affected. See [84970] for more details. [84970]: https://github.com/rust-lang/rust/issues/84970 Version 1.52.0 (2021-05-06) ============================ Language -------- - [Added the `unsafe_op_in_unsafe_fn` lint, which checks whether the unsafe code in an `unsafe fn` is wrapped in a `unsafe` block.][79208] This lint is allowed by default, and may become a warning or hard error in a future edition. - [You can now cast mutable references to arrays to a pointer of the same type as the element.][81479] Compiler -------- - [Upgraded the default LLVM to LLVM 12.][81451] Added tier 3\* support for the following targets. - [`s390x-unknown-linux-musl`][82166] - [`riscv32gc-unknown-linux-musl` & `riscv64gc-unknown-linux-musl`][82202] - [`powerpc-unknown-openbsd`][82733] \* Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. Libraries --------- - [`OsString` now implements `Extend` and `FromIterator`.][82121] - [`cmp::Reverse` now has `#[repr(transparent)]` representation.][81879] - [`Arc<impl Error>` now implements `error::Error`.][80553] - [All integer division and remainder operations are now `const`.][80962] Stabilised APIs ------------- - [`Arguments::as_str`] - [`char::MAX`] - [`char::REPLACEMENT_CHARACTER`] - [`char::UNICODE_VERSION`] - [`char::decode_utf16`] - [`char::from_digit`] - [`char::from_u32_unchecked`] - [`char::from_u32`] - [`slice::partition_point`] - [`str::rsplit_once`] - [`str::split_once`] The following previously stable APIs are now `const`. - [`char::len_utf8`] - [`char::len_utf16`] - [`char::to_ascii_uppercase`] - [`char::to_ascii_lowercase`] - [`char::eq_ignore_ascii_case`] - [`u8::to_ascii_uppercase`] - [`u8::to_ascii_lowercase`] - [`u8::eq_ignore_ascii_case`] Rustdoc ------- - [Rustdoc lints are now treated as a tool lint, meaning that lints are now prefixed with `rustdoc::` (e.g. `#[warn(rustdoc::non_autolinks)]`).][80527] Using the old style is still allowed, and will become a warning in a future release. - [Rustdoc now supports argument files.][82261] - [Rustdoc now generates smart punctuation for documentation.][79423] - [You can now use "task lists" in Rustdoc Markdown.][81766] E.g. ```markdown - [x] Complete - [ ] Todo ``` Misc ---- - [You can now pass multiple filters to tests.][81356] E.g. `cargo test -- foo bar` will run all tests that match `foo` and `bar`. - [Rustup now distributes PDB symbols for the `std` library on Windows, allowing you to see `std` symbols when debugging.][82218] Internal Only ------------- These changes provide no direct user facing benefits, but represent significant improvements to the internals and overall performance of rustc and related tools. - [Check the result cache before the DepGraph when ensuring queries][81855] - [Try fast_reject::simplify_type in coherence before doing full check][81744] - [Only store a LocalDefId in some HIR nodes][81611] - [Store HIR attributes in a side table][79519] Compatibility Notes ------------------- - [Cargo build scripts are now forbidden from setting `RUSTC_BOOTSTRAP`.][cargo/9181] - [Removed support for the `x86_64-rumprun-netbsd` target.][82594] - [Deprecated the `x86_64-sun-solaris` target in favor of `x86_64-pc-solaris`.][82216] - [Rustdoc now only accepts `,`, ` `, and `\t` as delimiters for specifying languages in code blocks.][78429] - [Rustc now catches more cases of `pub_use_of_private_extern_crate`][80763] - [Changes in how proc macros handle whitespace may lead to panics when used with older `proc-macro-hack` versions. A `cargo update` should be sufficient to fix this in all cases.][84136] [84136]: https://github.com/rust-lang/rust/issues/84136 [80763]: https://github.com/rust-lang/rust/pull/80763 [82166]: https://github.com/rust-lang/rust/pull/82166 [82121]: https://github.com/rust-lang/rust/pull/82121 [81879]: https://github.com/rust-lang/rust/pull/81879 [82261]: https://github.com/rust-lang/rust/pull/82261 [82218]: https://github.com/rust-lang/rust/pull/82218 [82216]: https://github.com/rust-lang/rust/pull/82216 [82202]: https://github.com/rust-lang/rust/pull/82202 [81855]: https://github.com/rust-lang/rust/pull/81855 [81766]: https://github.com/rust-lang/rust/pull/81766 [81744]: https://github.com/rust-lang/rust/pull/81744 [81611]: https://github.com/rust-lang/rust/pull/81611 [81479]: https://github.com/rust-lang/rust/pull/81479 [81451]: https://github.com/rust-lang/rust/pull/81451 [81356]: https://github.com/rust-lang/rust/pull/81356 [80962]: https://github.com/rust-lang/rust/pull/80962 [80553]: https://github.com/rust-lang/rust/pull/80553 [80527]: https://github.com/rust-lang/rust/pull/80527 [79519]: https://github.com/rust-lang/rust/pull/79519 [79423]: https://github.com/rust-lang/rust/pull/79423 [79208]: https://github.com/rust-lang/rust/pull/79208 [78429]: https://github.com/rust-lang/rust/pull/78429 [82733]: https://github.com/rust-lang/rust/pull/82733 [82594]: https://github.com/rust-lang/rust/pull/82594 [cargo/9181]: https://github.com/rust-lang/cargo/pull/9181 [`char::MAX`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.MAX [`char::REPLACEMENT_CHARACTER`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.REPLACEMENT_CHARACTER [`char::UNICODE_VERSION`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.UNICODE_VERSION [`char::decode_utf16`]: https://doc.rust-lang.org/std/primitive.char.html#method.decode_utf16 [`char::from_u32`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32 [`char::from_u32_unchecked`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32_unchecked [`char::from_digit`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_digit [`Peekable::next_if`]: https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if [`Peekable::next_if_eq`]: https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_eq [`Arguments::as_str`]: https://doc.rust-lang.org/stable/std/fmt/struct.Arguments.html#method.as_str [`str::split_once`]: https://doc.rust-lang.org/stable/std/primitive.str.html#method.split_once [`str::rsplit_once`]: https://doc.rust-lang.org/stable/std/primitive.str.html#method.rsplit_once [`slice::partition_point`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.partition_point [`char::len_utf8`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.len_utf8 [`char::len_utf16`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.len_utf16 [`char::to_ascii_uppercase`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.to_ascii_uppercase [`char::to_ascii_lowercase`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.to_ascii_lowercase [`char::eq_ignore_ascii_case`]: https://doc.rust-lang.org/stable/std/primitive.char.html#method.eq_ignore_ascii_case [`u8::to_ascii_uppercase`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_ascii_uppercase [`u8::to_ascii_lowercase`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.to_ascii_lowercase [`u8::eq_ignore_ascii_case`]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.eq_ignore_ascii_case
Update lang/rust to version 1.51.0.
Pkgsrc changes:
* Add support for the big-endian arm64 NetBSD target (aarch64_be).
* On NetBSD/i386, use the i586 (pentium) bootstrap kit variant in
preference to i686.
* Adjust patches, re-compute line offsets, re-compute crate checksums.
* Remove a patch which was either integrated upstream and/or no longer
applies.
* Bump bootstraps to 1.50.0.
* Move conditionals until after bsd.prefs.mk so that they work...
* Default to "dist" build target if cross-compiling, but allow
also to override via rust.BUILD_TARGET.
* Allow overriding MAKE_JOBS_SAFE via rust.MAKE_JOBS_SAFE if you
want a different trade-off between occasional breakage and performance.
* Adjust platform.mk according to work already done in wip/rust/
* Add a patch to optimize the install.sh script used to install binary
bootstraps to not do so many forks; use case/esac and parameter expansion
instead of grep, sed and cut.
* Drop building documentation for the binary bootstrap kits. This will
also impact the lang/rust-bin package. For full documentation, build
or install lang/rust as a package.
Upstream changes:
Version 1.51.0 (2021-03-25)
============================
Language
--------
- [You can now parameterize items such as functions, traits, and
`struct`s by constant values in addition to by types and
lifetimes.][79135] Also known as "const generics" E.g. you can
now write the following. Note: Only values of primitive integers,
`bool`, or `char` types are currently permitted.
```rust
struct GenericArray<T, const LENGTH: usize> {
inner: [T; LENGTH]
}
impl<T, const LENGTH: usize> GenericArray<T, LENGTH> {
const fn last(&self) -> Option<&T> {
if LENGTH == 0 {
None
} else {
Some(&self.inner[LENGTH - 1])
}
}
}
```
Compiler
--------
- [Added the `-Csplit-debuginfo` codegen option for macOS platforms.][79570]
This option controls whether debug information is split across
multiple files or packed into a single file. **Note** This option
is unstable on other platforms.
- [Added tier 3\* support for `aarch64_be-unknown-linux-gnu`,
`aarch64-unknown-linux-gnu_ilp32`, and
`aarch64_be-unknown-linux-gnu_ilp32` targets.][81455]
- [Added tier 3 support for `i386-unknown-linux-gnu` and
`i486-unknown-linux-gnu` targets.][80662]
- [The `target-cpu=native` option will now detect individual features
of CPUs.][80749]
\* Refer to Rust's [platform support page][platform-support-doc] for more
information on Rust's tiered platform support.
Libraries
---------
- [`Box::downcast` is now also implemented for any `dyn Any + Send
+ Sync` object.][80945]
- [`str` now implements `AsMut<str>`.][80279]
- [`u64` and `u128` now implement `From<char>`.][79502]
- [`Error` is now implemented for `&T` where `T` implements `Error`.][75180]
- [`Poll::{map_ok, map_err}` are now implemented for
`Poll<Option<Result<T,E>>>`.][80968]
- [`unsigned_abs` is now implemented for all signed integer types.][80959]
- [`io::Empty` now implements `io::Seek`.][78044]
- [`rc::Weak<T>` and `sync::Weak<T>`'s methods such as `as_ptr`
are now implemented for `T: ?Sized` types.][80764]
- [`Div` and `Rem` by their `NonZero` variant is now implemented
for all unsigned integers.][79134]
Stabilized APIs
---------------
- [`Arc::decrement_strong_count`]
- [`Arc::increment_strong_count`]
- [`Once::call_once_force`]
- [`Peekable::next_if_eq`]
- [`Peekable::next_if`]
- [`Seek::stream_position`]
- [`array::IntoIter`]
- [`panic::panic_any`]
- [`ptr::addr_of!`]
- [`ptr::addr_of_mut!`]
- [`slice::fill_with`]
- [`slice::split_inclusive_mut`]
- [`slice::split_inclusive`]
- [`slice::strip_prefix`]
- [`slice::strip_suffix`]
- [`str::split_inclusive`]
- [`sync::OnceState`]
- [`task::Wake`]
- [`VecDeque::range`]
- [`VecDeque::range_mut`]
Cargo
-----
- [Added the `split-debuginfo` profile option to control the -Csplit-debuginfo
codegen option.][cargo/9112]
- [Added the `resolver` field to `Cargo.toml` to enable the new
feature resolver and CLI option behavior.][cargo/8997] Version
2 of the feature resolver will try to avoid unifying features of
dependencies where that unification could be unwanted. Such as
using the same dependency with a `std` feature in a build scripts
and proc-macros, while using the `no-std` feature in the final
binary. See the [Cargo book documentation][feature-resolver@2.0]
for more information on the feature.
Rustdoc
-------
- [Rustdoc will now include documentation for methods available
from _nested_ `Deref` traits.][80653]
- [You can now provide a `--default-theme` flag which sets the
default theme to use for documentation.][79642]
Various improvements to intra-doc links:
- [You can link to non-path primitives such as `slice`.][80181]
- [You can link to associated items.][74489]
- [You can now include generic parameters when linking to items,
like `Vec<T>`.][76934]
Misc
----
- [You can now pass `--include-ignored` to tests (e.g. with
`cargo test -- --include-ignored`) to include testing tests marked
`#[ignore]`.][80053]
Compatibility Notes
-------------------
- [WASI platforms no longer use the `wasm-bindgen` ABI, and instead
use the wasm32 ABI.][79998]
- [`rustc` no longer promotes division, modulo and indexing operations
to `const` that could fail.][80579]
- [The minimum version of glibc for the following platforms has
been bumped to version 2.31 for the distributed artifacts.][81521]
- `armv5te-unknown-linux-gnueabi`
- `sparc64-unknown-linux-gnu`
- `thumbv7neon-unknown-linux-gnueabihf`
- `armv7-unknown-linux-gnueabi`
- `x86_64-unknown-linux-gnux32`
- [`atomic::spin_loop_hint` has been deprecated.][80966] It's
recommended to use `hint::spin_loop` instead.
Internal Only
-------------
- [Consistently avoid constructing optimized MIR when not doing codegen][80718]
[79135]: https://github.com/rust-lang/rust/pull/79135
[74489]: https://github.com/rust-lang/rust/pull/74489
[76934]: https://github.com/rust-lang/rust/pull/76934
[79570]: https://github.com/rust-lang/rust/pull/79570
[80181]: https://github.com/rust-lang/rust/pull/80181
[79642]: https://github.com/rust-lang/rust/pull/79642
[80945]: https://github.com/rust-lang/rust/pull/80945
[80279]: https://github.com/rust-lang/rust/pull/80279
[80053]: https://github.com/rust-lang/rust/pull/80053
[79502]: https://github.com/rust-lang/rust/pull/79502
[75180]: https://github.com/rust-lang/rust/pull/75180
[79135]: https://github.com/rust-lang/rust/pull/79135
[81521]: https://github.com/rust-lang/rust/pull/81521
[80968]: https://github.com/rust-lang/rust/pull/80968
[80959]: https://github.com/rust-lang/rust/pull/80959
[80718]: https://github.com/rust-lang/rust/pull/80718
[80653]: https://github.com/rust-lang/rust/pull/80653
[80579]: https://github.com/rust-lang/rust/pull/80579
[79998]: https://github.com/rust-lang/rust/pull/79998
[78044]: https://github.com/rust-lang/rust/pull/78044
[81455]: https://github.com/rust-lang/rust/pull/81455
[80764]: https://github.com/rust-lang/rust/pull/80764
[80749]: https://github.com/rust-lang/rust/pull/80749
[80662]: https://github.com/rust-lang/rust/pull/80662
[79134]: https://github.com/rust-lang/rust/pull/79134
[80966]: https://github.com/rust-lang/rust/pull/80966
[cargo/8997]: https://github.com/rust-lang/cargo/pull/8997
[cargo/9112]: https://github.com/rust-lang/cargo/pull/9112
[feature-resolver@2.0]: https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2
[`Once::call_once_force`]: https://doc.rust-lang.org/stable/std/sync/struct.Once.html#method.call_once_force
[`sync::OnceState`]: https://doc.rust-lang.org/stable/std/sync/struct.OnceState.html
[`panic::panic_any`]: https://doc.rust-lang.org/stable/std/panic/fn.panic_any.html
[`slice::strip_prefix`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.strip_prefix
[`slice::strip_suffix`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.strip_prefix
[`Arc::increment_strong_count`]: https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.increment_strong_count
[`Arc::decrement_strong_count`]: https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.decrement_strong_count
[`slice::fill_with`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.fill_with
[`ptr::addr_of!`]: https://doc.rust-lang.org/nightly/std/ptr/macro.addr_of.html
[`ptr::addr_of_mut!`]: https://doc.rust-lang.org/nightly/std/ptr/macro.addr_of_mut.html
[`array::IntoIter`]: https://doc.rust-lang.org/nightly/std/array/struct.IntoIter.html
[`slice::split_inclusive`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_inclusive
[`slice::split_inclusive_mut`]: https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.split_inclusive_mut
[`str::split_inclusive`]: https://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_inclusive
[`task::Wake`]: https://doc.rust-lang.org/nightly/std/task/trait.Wake.html
[`Seek::stream_position`]: https://doc.rust-lang.org/nightly/std/io/trait.Seek.html#method.stream_position
[`Peekable::next_if`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if
[`Peekable::next_if_eq`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if_eq
[`VecDeque::range`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range
[`VecDeque::range_mut`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range_mut
Fix errors and most warnings flagged by pkglint. Note to self: run pkglint before committing. Thanks to jperkin@ for the note.
Update lang/rust to version 1.50.0.
Pkgsrc changes:
* Adjust patches, re-compute line offsets, fix capitalization.
* Remove i686/FreeBSD support, no longer provided upstream.
* Bump bootstraps to 1.49.0.
* Change USE_TOOLS from bsdtar to gtar.
* Reduce diffs to pkgsrc-wip package patches.
* Allow rust.BUILD_TARGET to override automatic choice of target.
* Add an i586/NetBSD (pentium) bootstrap variant (needs testing),
not yet added as bootstrap since 1.49 doesn't have that variant.
Upstream changes:
Version 1.50.0 (2021-02-11)
============================
Language
-----------------------
- [You can now use `const` values for `x` in `[x; N]` array
expressions.][79270] This has been technically possible since
1.38.0, as it was unintentionally stabilized.
- [Assignments to `ManuallyDrop<T>` union fields are now considered
safe.][78068]
Compiler
-----------------------
- [Added tier 3\* support for the `armv5te-unknown-linux-uclibceabi`
target.][78142]
- [Added tier 3 support for the `aarch64-apple-ios-macabi` target.][77484]
- [The `x86_64-unknown-freebsd` is now built with the full toolset.][79484]
\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.
Libraries
-----------------------
- [`proc_macro::Punct` now implements `PartialEq<char>`.][78636]
- [`ops::{Index, IndexMut}` are now implemented for fixed sized
arrays of any length.][74989]
- [On Unix platforms, the `std::fs::File` type now has a "niche"
of `-1`.][74699] This value cannot be a valid file descriptor,
and now means `Option<File>` takes up the same amount of space
as `File`.
Stabilized APIs
---------------
- [`bool::then`]
- [`btree_map::Entry::or_insert_with_key`]
- [`f32::clamp`]
- [`f64::clamp`]
- [`hash_map::Entry::or_insert_with_key`]
- [`Ord::clamp`]
- [`RefCell::take`]
- [`slice::fill`]
- [`UnsafeCell::get_mut`]
The following previously stable methods are now `const`.
- [`IpAddr::is_ipv4`]
- [`IpAddr::is_ipv6`]
- [`Layout::size`]
- [`Layout::align`]
- [`Layout::from_size_align`]
- `pow` for all integer types.
- `checked_pow` for all integer types.
- `saturating_pow` for all integer types.
- `wrapping_pow` for all integer types.
- `next_power_of_two` for all unsigned integer types.
- `checked_power_of_two` for all unsigned integer types.
Cargo
-----------------------
- [Added the `[build.rustc-workspace-wrapper]` option.][cargo/8976]
This option sets a wrapper to execute instead of `rustc`, for
workspace members only.
- [`cargo:rerun-if-changed` will now, if provided a directory, scan the entire
contents of that directory for changes.][cargo/8973]
- [Added the `--workspace` flag to the `cargo update` command.][cargo/8725]
Misc
----
- [The search results tab and the help button are focusable with
keyboard in rustdoc.][79896]
- [Running tests will now print the total time taken to execute.][75752]
Compatibility Notes
-------------------
- [The `compare_and_swap` method on atomics has been deprecated.][79261]
It's recommended to use the `compare_exchange` and
`compare_exchange_weak` methods instead.
- [Changes in how `TokenStream`s are checked have fixed some cases
where you could write unhygenic `macro_rules!` macros.][79472]
- [`#![test]` as an inner attribute is now considered unstable like
other inner macro attributes, and reports an error by default
through the `soft_unstable` lint.][79003]
- [Overriding a `forbid` lint at the same level that it was set is
now a hard error.][78864]
- [Dropped support for all cloudabi targets.][78439]
- [You can no longer intercept `panic!` calls by supplying your
own macro.][78343] It's recommended to use the `#[panic_handler]`
attribute to provide your own implementation.
- [Semi-colons after item statements (e.g. `struct Foo {};`) now
produce a warning.][78296]
[74989]: https://github.com/rust-lang/rust/pull/74989
[79261]: https://github.com/rust-lang/rust/pull/79261
[79896]: https://github.com/rust-lang/rust/pull/79896
[79484]: https://github.com/rust-lang/rust/pull/79484
[79472]: https://github.com/rust-lang/rust/pull/79472
[79270]: https://github.com/rust-lang/rust/pull/79270
[79003]: https://github.com/rust-lang/rust/pull/79003
[78864]: https://github.com/rust-lang/rust/pull/78864
[78636]: https://github.com/rust-lang/rust/pull/78636
[78439]: https://github.com/rust-lang/rust/pull/78439
[78343]: https://github.com/rust-lang/rust/pull/78343
[78296]: https://github.com/rust-lang/rust/pull/78296
[78068]: https://github.com/rust-lang/rust/pull/78068
[75752]: https://github.com/rust-lang/rust/pull/75752
[74699]: https://github.com/rust-lang/rust/pull/74699
[78142]: https://github.com/rust-lang/rust/pull/78142
[77484]: https://github.com/rust-lang/rust/pull/77484
[cargo/8976]: https://github.com/rust-lang/cargo/pull/8976
[cargo/8973]: https://github.com/rust-lang/cargo/pull/8973
[cargo/8725]: https://github.com/rust-lang/cargo/pull/8725
[`IpAddr::is_ipv4`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv4
[`IpAddr::is_ipv6`]: https://doc.rust-lang.org/stable/std/net/enum.IpAddr.html#method.is_ipv6
[`Layout::align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align
[`Layout::from_size_align`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.from_size_align
[`Layout::size`]: https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.size
[`Ord::clamp`]: https://doc.rust-lang.org/stable/std/cmp/trait.Ord.html#method.clamp
[`RefCell::take`]: https://doc.rust-lang.org/stable/std/cell/struct.RefCell.html#method.take
[`UnsafeCell::get_mut`]: https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.get_mut
[`bool::then`]: https://doc.rust-lang.org/stable/std/primitive.bool.html#method.then
[`btree_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/btree_map/enum.Entry.html#method.or_insert_with_key
[`f32::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f32.html#method.clamp
[`f64::clamp`]: https://doc.rust-lang.org/stable/std/primitive.f64.html#method.clamp
[`hash_map::Entry::or_insert_with_key`]: https://doc.rust-lang.org/stable/std/collections/hash_map/enum.Entry.html#method.or_insert_with_key
[`slice::fill`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.fill
rust: Update cross instructions for illumos.
rust: Add support for cross-compiling illumos. It's not really cross-compiled, it's just a different target name, but is treated the same way. Once stabilised and crate support catches up we'll switch over to it by default from x86_64-sun-solaris. Until then I'll build bootstrap kits for both natively. While here fix up a bunch of obvious pkglint warnings.
Based on suggestion, add the "cross.mk" file which contains settings which may be tweaked to do a cross-build of rust. Include it from the main Makefile.