Skip to content

Tracking Issue for Hashing in const context #104061

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
1 of 3 tasks
onestacked opened this issue Nov 6, 2022 · 1 comment · Fixed by #132503
Closed
1 of 3 tasks

Tracking Issue for Hashing in const context #104061

onestacked opened this issue Nov 6, 2022 · 1 comment · Fixed by #132503
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-const_trait_impl `#![feature(const_trait_impl)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@onestacked
Copy link
Contributor

onestacked commented Nov 6, 2022

Feature gate: #![feature(const_hash)]

This is a tracking issue for constructing "hashers" in const conext.

Public API

// std::collections::hash
impl DefaultHasher {
    pub const fn new() -> DefaultHasher;
}

impl SipHasher {
    #[deprecated]
    pub const fn new() -> SipHasher;
    #[deprecated]
    pub const fn new_with_keys(key0: u64, key1: u64) -> SipHasher;
}
impl SipHasher13 {
    #[deprecated]
    pub const fn new() -> SipHasher;
    #[deprecated]
    pub const fn new_with_keys(key0: u64, key1: u64) -> SipHasher;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

@onestacked onestacked added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Nov 6, 2022
@fee1-dead fee1-dead added the F-const_trait_impl `#![feature(const_trait_impl)]` label Mar 24, 2023
@RalfJung
Copy link
Member

RalfJung commented Sep 8, 2024

Most of this feature got removed in #110393, I updated the description to match what is left.

@onestacked onestacked reopened this Sep 8, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Nov 2, 2024
better test for const HashMap; remove const_hash leftovers

The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (rust-lang#123197), so we also have a test that does not involve that type.

The second commit removes the last remnants of rust-lang#104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`.

Cc `@rust-lang/libs-api` `@rust-lang/wg-const-eval`
Closes rust-lang#104061
Related to rust-lang#102575
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Nov 3, 2024
better test for const HashMap; remove const_hash leftovers

The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (rust-lang#123197), so we also have a test that does not involve that type.

The second commit removes the last remnants of rust-lang#104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`.

Cc ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval``
Closes rust-lang#104061
Related to rust-lang#102575
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Nov 3, 2024
better test for const HashMap; remove const_hash leftovers

The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (rust-lang#123197), so we also have a test that does not involve that type.

The second commit removes the last remnants of rust-lang#104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`.

Cc ```@rust-lang/libs-api``` ```@rust-lang/wg-const-eval```
Closes rust-lang#104061
Related to rust-lang#102575
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 3, 2024
better test for const HashMap; remove const_hash leftovers

The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (rust-lang#123197), so we also have a test that does not involve that type.

The second commit removes the last remnants of rust-lang#104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`.

Cc `@rust-lang/libs-api` `@rust-lang/wg-const-eval`
Closes rust-lang#104061
Related to rust-lang#102575
@bors bors closed this as completed in e937938 Nov 3, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 3, 2024
Rollup merge of rust-lang#132503 - RalfJung:const-hash-map, r=Amanieu

better test for const HashMap; remove const_hash leftovers

The existing `const_with_hasher` test is kind of silly since the HashMap it constructs can never contain any elements. So this adjusts the test to construct a usable HashMap, which is a bit non-trivial since the default hash builder cannot be built in `const`. `BuildHasherDefault::new()` helps but is unstable (rust-lang#123197), so we also have a test that does not involve that type.

The second commit removes the last remnants of rust-lang#104061, since they aren't actually useful -- without const traits, you can't do any hashing in `const`.

Cc ``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval``
Closes rust-lang#104061
Related to rust-lang#102575
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC F-const_trait_impl `#![feature(const_trait_impl)]` T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants