Skip to content

Commit 7f1eb7f

Browse files
committed
impl hashstable for substsref
Change-Id: Idc024631af3ecbe352fb0d18c9184ab7f2d55a19
1 parent aa53d09 commit 7f1eb7f

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/librustc/ich/impls_ty.rs

+14
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,20 @@ impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ty::subst::Kind<'gcx> {
6262
}
6363
}
6464

65+
impl<'a, 'gcx> HashStable<StableHashingContext<'a>> for ty::subst::SubstsRef<'gcx> {
66+
fn hash_stable<W: StableHasherResult>(
67+
&self,
68+
hcx: &mut StableHashingContext<'a>,
69+
hasher: &mut StableHasher<W>,
70+
) {
71+
let ty::subst::SubstsRef {
72+
inner
73+
} = self;
74+
75+
inner.hash_stable(hcx, hasher);
76+
}
77+
}
78+
6579
impl<'a> HashStable<StableHashingContext<'a>>
6680
for ty::RegionKind {
6781
fn hash_stable<W: StableHasherResult>(&self,

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ impl<'a, 'tcx> LateContext<'a, 'tcx> {
822822
) -> Result<Self::Path, Self::Error> {
823823
if trait_ref.is_none() {
824824
if let ty::Adt(def, substs) = self_ty.sty {
825-
return self.print_def_path(def.did, substs);
825+
return self.print_def_path(def.did, &substs);
826826
}
827827
}
828828

src/librustc/ty/subst.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ impl<'tcx> Decodable for Kind<'tcx> {
180180
/// A substitution mapping generic parameters to new values.
181181
pub type InternalSubsts<'tcx> = List<Kind<'tcx>>;
182182

183-
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, RustcEncodable, RustcDecodable, HashStable)]
183+
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, RustcEncodable, RustcDecodable, Hash)]
184184
pub struct SubstsRef<'tcx> {
185-
inner: &'tcx InternalSubsts<'tcx>,
185+
pub inner: &'tcx InternalSubsts<'tcx>,
186186
}
187187

188188
impl<'tcx> From<&'tcx InternalSubsts<'tcx>> for SubstsRef<'tcx> {

0 commit comments

Comments
 (0)