Make Hash, Hasher and BuildHasher #[const_trait] and make Sip const Hasher#104060
Make Hash, Hasher and BuildHasher #[const_trait] and make Sip const Hasher#104060bors merged 6 commits intorust-lang:masterfrom
Hash, Hasher and BuildHasher #[const_trait] and make Sip const Hasher#104060Conversation
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
|
@rustbot label +T-libs-api -T-libs |
|
@rustbot label +const-hack |
This comment has been minimized.
This comment has been minimized.
04ab88f to
cebce1e
Compare
fee1-dead
left a comment
There was a problem hiding this comment.
Left some nits. Also, I would like to see some tests to ensure that it works (maybe not as an ui test, but under library/core/tests, next to the hash tests)
Should I add a new file or make the current tests const and add some asserts that check for differences between RT and CT? |
You should add const tests alongside the runtime asserts. Differences between RT and CT are generally not needed to test if you copy all runtime tests and make them const alongside the original tests. |
|
So copy the entire file and make it const there? |
|
Just the general tests. for example, in https://github.com/rust-lang/rust/blob/master/library/core/tests/hash/mod.rs you don't need |
8adc0da to
d20c739
Compare
d20c739 to
56e59bc
Compare
|
@bors r+ |
…-dead Make `Hash`, `Hasher` and `BuildHasher` `#[const_trait]` and make `Sip` const `Hasher` This PR enables using Hashes in const context. r? `@fee1-dead`
…earth Rollup of 9 pull requests Successful merges: - rust-lang#101939 (Add loongarch64 abi support) - rust-lang#103863 (Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor) - rust-lang#104036 (Suggest `is_some` when we've found `Option` but expected `bool`) - rust-lang#104060 (Make `Hash`, `Hasher` and `BuildHasher` `#[const_trait]` and make `Sip` const `Hasher`) - rust-lang#104077 (Use aapcs for efiapi calling convention on arm) - rust-lang#104186 (Tighten the 'introduce new binding' suggestion) - rust-lang#104194 (`EarlyBinder` docs) - rust-lang#104233 (Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor`) - rust-lang#104235 (Use `const_error_with_guaranteed` more) Failed merges: - rust-lang#104078 (Print "Checking/Building ..." message even when --dry-run is passed) - rust-lang#104169 (Migrate `:target` rules to use CSS variables) r? `@ghost` `@rustbot` modify labels: rollup
This PR enables using Hashes in const context.
r? @fee1-dead