Skip to content

Commit fbe0b2a

Browse files
committed
Get it compiling again
1 parent f992e65 commit fbe0b2a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

compiler/rustc_data_structures/src/intern.rs

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use std::hash::{Hash, Hasher};
33
use std::ops::Deref;
44
use std::ptr;
55

6+
use crate::stable_hasher::HashStableEq;
7+
68
mod private {
79
#[derive(Clone, Copy, Debug)]
810
pub struct PrivateZst;
@@ -52,6 +54,14 @@ impl<'a, T> Deref for Interned<'a, T> {
5254
}
5355
}
5456

57+
// FIXME - is this right? Should we try to enforce this somehow?
58+
impl<'a, T: HashStableEq> HashStableEq for Interned<'a, T> {
59+
fn hash_stable_eq(&self, other: &Self) -> bool {
60+
// Pointer equality implies equality, due to the uniqueness constraint.
61+
ptr::eq(self.0, other.0)
62+
}
63+
}
64+
5565
impl<'a, T> PartialEq for Interned<'a, T> {
5666
#[inline]
5767
fn eq(&self, other: &Self) -> bool {

compiler/rustc_middle/src/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use rustc_span::symbol::{kw, Ident, Symbol};
4343
use rustc_span::{sym, Span};
4444
use rustc_target::abi::Align;
4545

46-
use std::hash::{Hash, Hasher};
46+
use std::hash::Hash;
4747
use std::ops::ControlFlow;
4848
use std::{fmt, str};
4949

0 commit comments

Comments
 (0)