Skip to content

Commit 90b98b2

Browse files
committed
Use Hcx/hcx consistently for StableHashingContext.
The `HashStable` and `ToStableHashKey` traits both have a type parameter that is sometimes called `CTX` and sometimes called `HCX`. (In practice this type parameter is always instantiated as `StableHashingContext`.) Similarly, variables with these types are sometimes called `ctx` and sometimes called `hcx`. This inconsistency has bugged me for some time. The `HCX`/`hcx` form is more informative (the `H`/`h` indicates what type of context it is) and it matches other cases like `tcx`, `dcx`, `icx`. Also, RFC 430 says that type parameters should have names that are "concise UpperCamelCase, usually single uppercase letter: T". In this case `H` feels insufficient, and `Hcx` feels better. Therefore, this commit changes the code to use `Hcx`/`hcx` everywhere.
1 parent 496728e commit 90b98b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/driver/aot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ enum OngoingModuleCodegen {
4545
Async(JoinHandle<Result<ModuleCodegenResult, String>>),
4646
}
4747

48-
impl<HCX> HashStable<HCX> for OngoingModuleCodegen {
49-
fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) {
48+
impl<Hcx> HashStable<Hcx> for OngoingModuleCodegen {
49+
fn hash_stable(&self, _: &mut Hcx, _: &mut StableHasher) {
5050
// do nothing
5151
}
5252
}

0 commit comments

Comments
 (0)