diff options
| author | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2019-10-16 13:46:44 +0900 |
|---|---|---|
| committer | Shotaro Yamada <sinkuu@sinkuu.xyz> | 2019-10-16 13:46:44 +0900 |
| commit | d5ffd36a6cd6fa03b09a60a3835ce6ca90c310ff (patch) | |
| tree | a554d07942a9d9a793bb601586b34cf3f0760109 /src | |
| parent | e369d87b015a84653343032833d65d0545fd3f26 (diff) | |
| download | rust-d5ffd36a6cd6fa03b09a60a3835ce6ca90c310ff.tar.gz rust-d5ffd36a6cd6fa03b09a60a3835ce6ca90c310ff.zip | |
Change HashSet element type to `DefId`
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_mir/hair/pattern/mod.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index 58d741b9295..72e6970ebba 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -1217,7 +1217,7 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'tcx>, // 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> { @@ -1257,14 +1257,12 @@ fn search_for_adt_without_structural_match<'tcx>(tcx: TyCtxt<'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 |
