-
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
Add std::hash::{DefaultHasher, RandomState}
exports (needs FCP)
#115694
Conversation
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
f011aa7
to
e9b83cf
Compare
This comment has been minimized.
This comment has been minimized.
12520ae
to
26d14ac
Compare
This comment has been minimized.
This comment has been minimized.
52ef133
to
b195f5d
Compare
b195f5d
to
c4b514b
Compare
Since the ACP got accepted, it's up to the reviewer whether we make this have an FCP here to add new aliases or save that for another PR. (I'm fine with either.) I believe that re-exports can't have separate stability flags, but I could be wrong, in which case I can unstably export them in |
c4b514b
to
693f026
Compare
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/rust-analyzer cc @rust-lang/rust-analyzer Some changes occurred in src/tools/clippy cc @rust-lang/clippy These commits modify compiler targets. |
693f026
to
b91d63d
Compare
(Apologies for the @ mentions; I removed the subtree commits.) |
I checked, and yes, aliases are insta-stable (you can mark them as unstable, but it won't actually require the feature flag to use them). I decided I'd just go ahead with making the aliases and we can either do an FCP, or we can remove the second commit. I also tried to replace code in the tree that used the old exports, although as you can see, I accidentally included some subtrees that are now removed. |
RandomState
and DefaultHasher
into std::hash
, but in a sneaky waystd::hash::{DefaultHasher, RandomState}
exports (needs FCP)
@rustbot label needs-FCP |
This comment has been minimized.
This comment has been minimized.
eb851d4
to
4bee554
Compare
Gentle nudge @thomcc (or any libs-team members around) to start FCP for merging these aliases. Unfortunately we can't make aliases have a separate stability attribute from what I've gathered. |
Does this need libs-api or libs FCP? I can only start libs, not libs-api, and I thought this needed API. |
Oh, then yes, it does need libs-api FCP. I'm not sure who would be appropriate for that then. |
Add `std::hash::{DefaultHasher, RandomState}` exports (needs FCP) This implements rust-lang/libs-team#267 to move the libstd hasher types to `std::hash` where they belong, instead of `std::collections::hash_map`. <details><summary>The below no longer applies, but is kept for clarity.</summary> This is a small refactor for rust-lang#27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API. I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of `std::hash`, but for now, they're at least separated out from the collections code in a way that will make moving that around easier. I decided to simply copy the rustdoc for `std::hash` from `core::hash` since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred. </details>
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@dtolnay looks spurious, maybe retry? |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (2c1b65e): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
Binary sizeResultsThis 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.
Bootstrap: 673.486s -> 674.671s (0.18%) |
* chore(src/lib.rs): `RandomState` now exported in `std::hash` see https://github.com/rust-lang/rust/releases/tag/1.76.0 see rust-lang/rust#115694 * chore(ci/cd): handle `rustup update stable` when there is a version mismatch between stable toolchain installed on runner (used) and stable toolchain available from upstream (latest)
* chore(src/lib.rs): `{RandomState, DefaultHasher}` now exported in `std::hash` see https://github.com/rust-lang/rust/releases/tag/1.76.0 see rust-lang/rust#115694 * chore(ci): handle `rustup update stable` when there is a version mismatch between stable toolchain installed on runner (used) and stable toolchain available from upstream (latest)
Pkgsrc changes: * Adapt checksums and patches. Upstream chnages: Version 1.76.0 (2024-02-08) ========================== Language -------- - [Document Rust ABI compatibility between various types] (rust-lang/rust#115476) - [Also: guarantee that char and u32 are ABI-compatible] (rust-lang/rust#118032) - [Warn against ambiguous wide pointer comparisons] (rust-lang/rust#117758) Compiler -------- - [Lint pinned `#[must_use]` pointers (in particular, `Box<T>` where `T` is `#[must_use]`) in `unused_must_use`.] (rust-lang/rust#118054) - [Soundness fix: fix computing the offset of an unsized field in a packed struct] (rust-lang/rust#118540) - [Soundness fix: fix dynamic size/align computation logic for packed types with dyn Trait tail] (rust-lang/rust#118538) - [Add `$message_type` field to distinguish json diagnostic outputs] (rust-lang/rust#115691) - [Enable Rust to use the EHCont security feature of Windows] (rust-lang/rust#118013) - [Add tier 3 {x86_64,i686}-win7-windows-msvc targets] (rust-lang/rust#118150) - [Add tier 3 aarch64-apple-watchos target] (rust-lang/rust#119074) - [Add tier 3 arm64e-apple-ios & arm64e-apple-darwin targets] (rust-lang/rust#115526) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. Libraries --------- - [Add a column number to `dbg!()`] (rust-lang/rust#114962) - [Add `std::hash::{DefaultHasher, RandomState}` exports] (rust-lang/rust#115694) - [Fix rounding issue with exponents in fmt] (rust-lang/rust#116301) - [Add T: ?Sized to `RwLockReadGuard` and `RwLockWriteGuard`'s Debug impls.] (rust-lang/rust#117138) - [Windows: Allow `File::create` to work on hidden files] (rust-lang/rust#116438) Stabilized APIs --------------- - [`Arc::unwrap_or_clone`] (https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.unwrap_or_clone) - [`Rc::unwrap_or_clone`] (https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.unwrap_or_clone) - [`Result::inspect`] (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect) - [`Result::inspect_err`] (https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.inspect_err) - [`Option::inspect`] (https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.inspect) - [`type_name_of_val`] (https://doc.rust-lang.org/stable/std/any/fn.type_name_of_val.html) - [`std::hash::{DefaultHasher, RandomState}`] (https://doc.rust-lang.org/stable/std/hash/index.html#structs) These were previously available only through `std::collections::hash_map`. - [`ptr::{from_ref, from_mut}`] (https://doc.rust-lang.org/stable/std/ptr/fn.from_ref.html) - [`ptr::addr_eq`](https://doc.rust-lang.org/stable/std/ptr/fn.addr_eq.html) Cargo ----- See [Cargo release notes] (https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-176-2024-02-08). Rustdoc ------- - [Don't merge cfg and doc(cfg) attributes for re-exports] (rust-lang/rust#113091) - [rustdoc: allow resizing the sidebar / hiding the top bar] (rust-lang/rust#115660) - [rustdoc-search: add support for traits and associated types] (rust-lang/rust#116085) - [rustdoc: Add highlighting for comments in items declaration] (rust-lang/rust#117869) Compatibility Notes ------------------- - [Add allow-by-default lint for unit bindings] (rust-lang/rust#112380) This is expected to be upgraded to a warning by default in a future Rust release. Some macros emit bindings with type `()` with user-provided spans, which means that this lint will warn for user code. - [Remove x86_64-sun-solaris target.] (rust-lang/rust#118091) - [Remove asmjs-unknown-emscripten target] (rust-lang/rust#117338) - [Report errors in jobserver inherited through environment variables] (rust-lang/rust#113730) This [may warn](rust-lang/rust#120515) on benign problems too. - [Update the minimum external LLVM to 16.] (rust-lang/rust#117947) - [Improve `print_tts`](rust-lang/rust#114571) This change can break some naive manual parsing of token trees in proc macro code which expect a particular structure after `.to_string()`, rather than just arbitrary Rust code. - [Make `IMPLIED_BOUNDS_ENTAILMENT` into a hard error from a lint] (rust-lang/rust#117984) - [Vec's allocation behavior was changed when collecting some iterators] (rust-lang/rust#110353) Allocation behavior is currently not specified, nevertheless changes can be surprising. See [`impl FromIterator for Vec`] (https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#impl-FromIterator%3CT%3E-for-Vec%3CT%3E) for more details. - [Properly reject `default` on free const items] (rust-lang/rust#117818)
This implements rust-lang/libs-team#267 to move the libstd hasher types to
std::hash
where they belong, instead ofstd::collections::hash_map
.The below no longer applies, but is kept for clarity.
This is a small refactor for #27242, which moves the definitions of `RandomState` and `DefaultHasher` into `std::hash`, but in a way that won't be noticed in the public API.I've opened rust-lang/libs-team#267 as a formal ACP to move these directly into the root of
std::hash
, but for now, they're at least separated out from the collections code in a way that will make moving that around easier.I decided to simply copy the rustdoc for
std::hash
fromcore::hash
since I think it would be ideal for the two to diverge longer-term, especially if the ACP is accepted. However, I would be willing to factor them out into a common markdown document if that's preferred.