// tracks ADT's previously encountered during search, so that
// we will not recur on them again.
- seen: FxHashSet<&'tcx AdtDef>,
+ seen: FxHashSet<hir::def_id::DefId>,
}
impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
return true // Halt visiting!
}
- if self.seen.contains(adt_def) {
+ if !self.seen.insert(adt_def.did) {
debug!("Search already seen adt_def: {:?}", adt_def);
// let caller continue its search
return false;
}
- self.seen.insert(adt_def);
-
// `#[structural_match]` does not care about the
// instantiation of the generics in an ADT (it
// instead looks directly at its fields outside