Clean up QueryVTable::hash_result into hash_value_fn#153209
Clean up QueryVTable::hash_result into hash_value_fn#153209rust-bors[bot] merged 1 commit intorust-lang:mainfrom
QueryVTable::hash_result into hash_value_fn#153209Conversation
| [$($modifiers)*] | ||
| None | ||
| (Some($crate::plumbing::hash_erased_value::<queries::$name::Value<'tcx>>)) | ||
| ), |
There was a problem hiding this comment.
Just use an expr block here and avoid creating hash_erased_value (and its complicated signature). Less code and easier to read, IMO, because you don't need to look elsewhere.
There was a problem hiding this comment.
I think there are advantages to having the separate function with its explicit signature, but it's a close call and the inline closure is reasonable, so I've changed to the inline closure.
|
The commit message seems out of date, it needs some more details. r=me with that fixed and the nits fixed. |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This commit: - Renames the query vtable field `hash_result` to `hash_value_fn` - Removes the unhelpful `HashResult` type alias, which was hiding an important layer of `Option` - Replaces the cryptic `hash_result!` helper macro with a more straightforward `if_no_hash!` helper, in line with other modifier-checking macros - Renames a few identifiers to refer to a query's return value as `value`
I don't understand this request; do you mean that I should copy the PR description into the (previously empty) commit message? If so, I've just done that. |
|
Thanks! @bors r+ rollup |
Rollup of 5 pull requests Successful merges: - #152042 (Suggest async block instead of async closure when possible) - #152949 (Introduce --ci flag in tidy) - #152655 (Disable debug_assert_not_in_new_nodes for multiple threads) - #153209 (Clean up `QueryVTable::hash_result` into `hash_value_fn`) - #153229 (rustfmt: add test for field representing type builtin syntax)
Rollup of 5 pull requests Successful merges: - #152042 (Suggest async block instead of async closure when possible) - #152949 (Introduce --ci flag in tidy) - #152655 (Disable debug_assert_not_in_new_nodes for multiple threads) - #153209 (Clean up `QueryVTable::hash_result` into `hash_value_fn`) - #153229 (rustfmt: add test for field representing type builtin syntax)
Rollup merge of #153209 - Zalathar:hash-value-fn, r=nnethercote Clean up `QueryVTable::hash_result` into `hash_value_fn` This PR: - Renames the query vtable field `hash_result` to `hash_value_fn` - Removes the unhelpful `HashResult` type alias, which was hiding an important layer of `Option` - Replaces the cryptic `hash_result!` helper macro with a more straightforward `if_no_hash!` helper, in line with other modifier-checking macros - Renames a few identifiers to refer to a query's return value as `value` There should be no change to compiler behaviour. r? nnethercote (or compiler)
This PR:
hash_resulttohash_value_fnHashResulttype alias, which was hiding an important layer ofOptionhash_result!helper macro with a more straightforwardif_no_hash!helper, in line with other modifier-checking macrosvalueThere should be no change to compiler behaviour.
r? nnethercote (or compiler)