-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use 128 bits for TypeId hash #109953
Use 128 bits for TypeId hash #109953
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
|
Oh, it fails because tracing-subscriber relies on TypeId being u64. :| |
I've added a hacky |
Going to do a perf run, since it was mentioned as a concern. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 50ae15ede9be80c090a51d6a89218a32169b50df with merge 95d90d2f6d4495fee62f69cf14fe3ec6d009965e... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (95d90d2f6d4495fee62f69cf14fe3ec6d009965e): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri |
library/core/src/any.rs
Outdated
// (especially given the previous point about the lower 64 bits being | ||
// high quality on their own). | ||
// | ||
// That said, this is a bit of a hack. (FIXME(thom): nominate this for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't land without me doing this (but it probably would be premature before the MCP completes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping: the MCP was completed, do you still want to nominate this for T-libs
?
(IMO this impl can be changed after/asynchronously to this PR — as discussed here previously, this implementation is totally fine for the Hash
trait)
cc @alice-i-cecile maybe this should be benchmarked with Bevy? |
cc-ing @Badel2 @CAD97 @m-ou-se @digama0 @RalfJung @nikomatsakis @joshtriplett (based on comments you each had on #95845 regarding hashes - apologies if this PR isn't relevant, but I wanted to at least connect those dots) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation LGTM
Wow, so excited to see this finally being fixed! Regarding hashing only the lower u64 in the Hash impl, that it is a common and perfectly valid way to truncate a cryptographically secure hash function, it is even in the standard for SHA-2. And even if the hash function used by TypeId is not cryptographically secure, the worst attack which is creating hash collisions will have the same cost as if we were hashing the full u128 since the output of Hash::finish is a u64 anyway. The only problem is that it is possible to create a TypeId using transmute, and in that case creating a collision is free because we can modify the output of the first hash function. (transmute TypeId to u128, modify without touching lower u64, transmute back to TypeId). The impact of that problem is that you can make a hashmap O(n^2), but only in your own code, so I will let someone else decide if it is worth to fix it. After taking a look at the offending code that breaks, here: https://github.com/tokio-rs/tracing/blob/3392be93cb9262a5da54c23e5772e79a8736d50e/tracing-subscriber/src/registry/extensions.rs#L27 I propose to just call write_u64 twice. This will avoid worrying about the hash collisions created using transmute, and it will not break tracing-subscriber, which will only use the input of the second call as the hash. Also the last time I remember talking about this, the problem was that some crates are using transmute between TypeId and u64, how is that fixed here? Was that fixed in those crates at some point? Thank you for moving this issue forward! |
This is what I did initially, after looking at the same code. That said, I find @eddyb's argument that it's fine to just use 64 bits pretty compelling.
We're not really concerned about attacks, so much as accidental collisions.
It's not. Those crates are going to be broken no matter how we fix this issue (even the string pointer approach probably won't work right for them, although I suppose on 64 bit targets they might be less broken), the only way to keep them working is to decide this never changes, which seems unreasonable. In the past we haven't really considered that reason to avoid a motivated fix; for example, plenty of code used to do type punning between std::net types and libc... although it's possible the breakage in this case could be too much to bear. It's worth doing a crater run for this at least, if for no other reason than to give such code a heads up. |
Given the T-libs approval modulo comment in #109953 (comment) and the comment being fixed, @bors r+ rollup 🎉 |
…iaskrgr Rollup of 4 pull requests Successful merges: - rust-lang#109953 (Use 128 bits for TypeId hash) - rust-lang#112333 (Don't hold the active queries lock while calling `make_query`) - rust-lang#112339 (Fix rust-analyzer proc macro server) - rust-lang#112410 (Do `fix_*_builtin_expr` hacks on the writeback results) r? `@ghost` `@rustbot` modify labels: rollup
rust-lang/rust#109953 made std TypeId 128 bits and its new Hash impl prevents the use of TypeIdHasher so I'll be using a pointer cast going forward
Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning](rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root](rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64](rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint](rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint](rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint](rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint](rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors](rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics](rust-lang/rust#109005) - [Support for native WASM exceptions](rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).](rust-lang/rust#111326) - [Write to stdout if `-` is given as output file](rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary](rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`](rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`](rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen](rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.](rust-lang/rust#112039) 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}`](rust-lang/rust#99587) - [io: soften ‘at most one write attempt’ requirement in io::Write::write](rust-lang/rust#107200) - [Specify behavior of HashSet::insert](rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`](rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited](rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators](rust-lang/rust#112632) - [Use 128 bits for TypeId hash](rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.](rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon](rust-lang/rust#108537) - [Add search result item types after their name](rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`](rust-lang/rust#111958) - [Clean up type unification and "unboxing"](rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [openwrt#12221](rust-lang/cargo#12221) [openwrt#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [openwrt#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](rust-lang/rust#112606) - 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. [openwrt#12291](rust-lang/cargo#12291) Refreshed patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning](rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root](rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64](rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint](rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint](rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint](rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint](rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors](rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics](rust-lang/rust#109005) - [Support for native WASM exceptions](rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).](rust-lang/rust#111326) - [Write to stdout if `-` is given as output file](rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary](rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`](rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`](rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen](rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.](rust-lang/rust#112039) 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}`](rust-lang/rust#99587) - [io: soften ‘at most one write attempt’ requirement in io::Write::write](rust-lang/rust#107200) - [Specify behavior of HashSet::insert](rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`](rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited](rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators](rust-lang/rust#112632) - [Use 128 bits for TypeId hash](rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.](rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon](rust-lang/rust#108537) - [Add search result item types after their name](rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`](rust-lang/rust#111958) - [Clean up type unification and "unboxing"](rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [openwrt#12221](rust-lang/cargo#12221) [openwrt#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [openwrt#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](rust-lang/rust#112606) - 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. [openwrt#12291](rust-lang/cargo#12291) Refreshed patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Summary: * `TypeId` is `u128` [in Rust 1.72](rust-lang/rust#109953) * `u128` is 16 bytes aligned on Apple Silicon * we require 8 byte alignment for `StarlarkValue` Maybe we should fix heap allocations: insert padding to allow any alignment. But practically we don't need it and should not do it: generated machine code is identical for aligned and 8-byte aligned `u128`: [compiler explorer](https://rust.godbolt.org/z/96KsnjW77) (note it is identical if we load it from memory not pass by value, but this is what we do). So for now just force 8 byte alignment on `TypeId`. Fixes issue facebook/buck2#408 Reviewed By: ndmitchell, shayne-fletcher Differential Revision: D49019964 fbshipit-source-id: 62c8d7db83e9e4bdbe58fe7a62d5daae41996e61
Summary: * `TypeId` is `u128` [in Rust 1.72](rust-lang/rust#109953) * `u128` is 16 bytes aligned on Apple Silicon * we require 8 byte alignment for `StarlarkValue` Maybe we should fix heap allocations: insert padding to allow any alignment. But practically we don't need it and should not do it: generated machine code is identical for aligned and 8-byte aligned `u128`: [compiler explorer](https://rust.godbolt.org/z/96KsnjW77) (note it is identical if we load it from memory not pass by value, but this is what we do). So for now just force 8 byte alignment on `TypeId`. Fixes issue #408 Reviewed By: ndmitchell, shayne-fletcher Differential Revision: D49019964 fbshipit-source-id: 62c8d7db83e9e4bdbe58fe7a62d5daae41996e61
Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning](rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root](rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64](rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint](rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint](rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint](rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint](rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors](rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics](rust-lang/rust#109005) - [Support for native WASM exceptions](rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).](rust-lang/rust#111326) - [Write to stdout if `-` is given as output file](rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary](rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`](rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`](rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen](rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.](rust-lang/rust#112039) 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}`](rust-lang/rust#99587) - [io: soften ‘at most one write attempt’ requirement in io::Write::write](rust-lang/rust#107200) - [Specify behavior of HashSet::insert](rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`](rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited](rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators](rust-lang/rust#112632) - [Use 128 bits for TypeId hash](rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.](rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon](rust-lang/rust#108537) - [Add search result item types after their name](rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`](rust-lang/rust#111958) - [Clean up type unification and "unboxing"](rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [openwrt#12221](rust-lang/cargo#12221) [openwrt#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [openwrt#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](rust-lang/rust#112606) - 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. [openwrt#12291](rust-lang/cargo#12291) Refreshed patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org> (cherry picked from commit 846ee0b) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning](rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root](rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64](rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint](rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint](rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint](rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint](rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors](rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics](rust-lang/rust#109005) - [Support for native WASM exceptions](rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).](rust-lang/rust#111326) - [Write to stdout if `-` is given as output file](rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary](rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`](rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`](rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen](rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.](rust-lang/rust#112039) 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}`](rust-lang/rust#99587) - [io: soften ‘at most one write attempt’ requirement in io::Write::write](rust-lang/rust#107200) - [Specify behavior of HashSet::insert](rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`](rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited](rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators](rust-lang/rust#112632) - [Use 128 bits for TypeId hash](rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.](rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon](rust-lang/rust#108537) - [Add search result item types after their name](rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`](rust-lang/rust#111958) - [Clean up type unification and "unboxing"](rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [#12221](rust-lang/cargo#12221) [#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](rust-lang/rust#112606) - 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](rust-lang/cargo#12291) Refreshed patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org> (cherry picked from commit 846ee0b) Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Pkgsrc changes: * Adjust patches and cargo checksums to new versions. Upstream changes: Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning] (rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root] (rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64] (rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint] (rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint] (rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint] (rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint] (rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors] (rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects] (rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics] (rust-lang/rust#109005) - [Support for native WASM exceptions] (rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).] (rust-lang/rust#111326) - [Write to stdout if `-` is given as output file] (rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary] (rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`] (rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`] (rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen] (rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.] (rust-lang/rust#112039) 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}`] (rust-lang/rust#99587) - [io: soften â<80><98>at most one write attemptâ<80><99> requirement in io::Write::write] (rust-lang/rust#107200) - [Specify behavior of HashSet::insert] (rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`] (rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`] (rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited] (rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators] (rust-lang/rust#112632) - [Use 128 bits for TypeId hash] (rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.] (rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata] (rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon] (rust-lang/rust#108537) - [Add search result item types after their name] (rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`] (rust-lang/rust#111958) - [Clean up type unification and "unboxing"] (rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`] (https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`] (https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`] (https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`] (https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`] (https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`] (https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`] (https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [#12221](rust-lang/cargo#12221) [#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses] (rust-lang/rust#112606) - 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](rust-lang/cargo#12291)
Version 1.72.0 (2023-08-24) ========================== Language -------- - [Replace const eval limit by a lint and add an exponential backoff warning](rust-lang/rust#103877) - [expand: Change how `#![cfg(FALSE)]` behaves on crate root](rust-lang/rust#110141) - [Stabilize inline asm for LoongArch64](rust-lang/rust#111235) - [Uplift `clippy::undropped_manually_drops` lint](rust-lang/rust#111530) - [Uplift `clippy::invalid_utf8_in_unchecked` lint](rust-lang/rust#111543) - [Uplift `clippy::cast_ref_to_mut` lint](rust-lang/rust#111567) - [Uplift `clippy::cmp_nan` lint](rust-lang/rust#111818) - [resolve: Remove artificial import ambiguity errors](rust-lang/rust#112086) - [Don't require associated types with Self: Sized bounds in `dyn Trait` objects](rust-lang/rust#112319) Compiler -------- - [Remember names of `cfg`-ed out items to mention them in diagnostics](rust-lang/rust#109005) - [Support for native WASM exceptions](rust-lang/rust#111322) - [Add support for NetBSD/aarch64-be (big-endian arm64).](rust-lang/rust#111326) - [Write to stdout if `-` is given as output file](rust-lang/rust#111626) - [Force all native libraries to be statically linked when linking a static binary](rust-lang/rust#111698) - [Add Tier 3 support for `loongarch64-unknown-none*`](rust-lang/rust#112310) - [Prevent `.eh_frame` from being emitted for `-C panic=abort`](rust-lang/rust#112403) - [Support 128-bit enum variant in debuginfo codegen](rust-lang/rust#112474) - [compiler: update solaris/illumos to enable tsan support.](rust-lang/rust#112039) 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}`](rust-lang/rust#99587) - [io: soften ‘at most one write attempt’ requirement in io::Write::write](rust-lang/rust#107200) - [Specify behavior of HashSet::insert](rust-lang/rust#107619) - [Relax implicit `T: Sized` bounds on `BufReader<T>`, `BufWriter<T>` and `LineWriter<T>`](rust-lang/rust#111074) - [Update runtime guarantee for `select_nth_unstable`](rust-lang/rust#111974) - [Return `Ok` on kill if process has already exited](rust-lang/rust#112594) - [Implement PartialOrd for `Vec`s over different allocators](rust-lang/rust#112632) - [Use 128 bits for TypeId hash](rust-lang/rust#109953) - [Don't drain-on-drop in DrainFilter impls of various collections.](rust-lang/rust#104455) - [Make `{Arc,Rc,Weak}::ptr_eq` ignore pointer metadata](rust-lang/rust#106450) Rustdoc ------- - [Allow whitespace as path separator like double colon](rust-lang/rust#108537) - [Add search result item types after their name](rust-lang/rust#110688) - [Search for slices and arrays by type with `[]`](rust-lang/rust#111958) - [Clean up type unification and "unboxing"](rust-lang/rust#112233) Stabilized APIs --------------- - [`impl<T: Send> Sync for mpsc::Sender<T>`](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Sender.html#impl-Sync-for-Sender%3CT%3E) - [`impl TryFrom<&OsStr> for &str`](https://doc.rust-lang.org/nightly/std/primitive.str.html#impl-TryFrom%3C%26'a+OsStr%3E-for-%26'a+str) - [`String::leak`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#method.leak) These APIs are now stable in const contexts: - [`CStr::from_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_bytes_with_nul`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) - [`CStr::to_str`](https://doc.rust-lang.org/nightly/std/ffi/struct.CStr.html#method.from_bytes_with_nul) 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](https://doc.rust-lang.org/nightly/cargo/commands/cargo-test.html#working-directory-of-tests) [openwrt#12221](rust-lang/cargo#12221) [openwrt#12288](rust-lang/cargo#12288) - Add support of the "default" keyword to reset previously set `build.jobs` parallelism back to the default. [openwrt#12222](rust-lang/cargo#12222) Compatibility Notes ------------------- - [Alter `Display` for `Ipv6Addr` for IPv4-compatible addresses](rust-lang/rust#112606) - 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. [openwrt#12291](rust-lang/cargo#12291) Refreshed patches. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
Preliminary/Draft impl of rust-lang/compiler-team#608
Prior art (probably incomplete list)