Skip to content

Commit d5ffd36

Browse files
committed
Change HashSet element type to DefId
1 parent e369d87 commit d5ffd36

File tree

1 file changed

+2
-4
lines changed
  • src/librustc_mir/hair/pattern

1 file changed

+2
-4
lines changed

src/librustc_mir/hair/pattern/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>,
12171217

12181218
// tracks ADT's previously encountered during search, so that
12191219
// we will not recur on them again.
1220-
seen: FxHashSet<&'tcx AdtDef>,
1220+
seen: FxHashSet<hir::def_id::DefId>,
12211221
}
12221222

12231223
impl<'tcx> TypeVisitor<'tcx> for Search<'tcx> {
@@ -1257,14 +1257,12 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>,
12571257
return true // Halt visiting!
12581258
}
12591259

1260-
if self.seen.contains(adt_def) {
1260+
if !self.seen.insert(adt_def.did) {
12611261
debug!("Search already seen adt_def: {:?}", adt_def);
12621262
// let caller continue its search
12631263
return false;
12641264
}
12651265

1266-
self.seen.insert(adt_def);
1267-
12681266
// `#[structural_match]` does not care about the
12691267
// instantiation of the generics in an ADT (it
12701268
// instead looks directly at its fields outside

0 commit comments

Comments
 (0)