mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Fix HashStable implementation on InferTy
This commit is contained in:
parent
8f117a77d0
commit
75729afcc0
@ -559,6 +559,7 @@ impl<CTX> HashStable<CTX> for FloatTy {
|
||||
impl<CTX> HashStable<CTX> for InferTy {
|
||||
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
|
||||
use InferTy::*;
|
||||
discriminant(self).hash_stable(ctx, hasher);
|
||||
match self {
|
||||
TyVar(v) => v.as_u32().hash_stable(ctx, hasher),
|
||||
IntVar(v) => v.index.hash_stable(ctx, hasher),
|
||||
|
17
src/test/ui/traits/vtable/issue-91807.rs
Normal file
17
src/test/ui/traits/vtable/issue-91807.rs
Normal file
@ -0,0 +1,17 @@
|
||||
// check-pass
|
||||
// incremental
|
||||
|
||||
struct Struct<T>(T);
|
||||
|
||||
impl<T> std::ops::Deref for Struct<T> {
|
||||
type Target = dyn Fn(T);
|
||||
fn deref(&self) -> &Self::Target {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let f = Struct(Default::default());
|
||||
f(0);
|
||||
f(0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user