]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/impl_wf_check.rs
Auto merge of #68672 - jonas-schievink:dedup-witness, r=Zoxc
[rust.git] / src / librustc_typeck / impl_wf_check.rs
index fb87b285fa29f56e139ea257cfdcb815ed643c0a..e9c18b59da9824146f05b46ff3381a198d69f783 100644 (file)
@@ -20,8 +20,6 @@
 
 use rustc_span::Span;
 
-use rustc_error_codes::*;
-
 /// Checks that all the type/lifetime parameters on an impl also
 /// appear in the trait ref or self type (or are constrained by a
 /// where-clause). These rules are needed to ensure that, given a
@@ -75,10 +73,10 @@ struct ImplWfCheck<'tcx> {
 
 impl ItemLikeVisitor<'tcx> for ImplWfCheck<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
-        if let hir::ItemKind::Impl(.., ref impl_item_refs) = item.kind {
+        if let hir::ItemKind::Impl { ref items, .. } = item.kind {
             let impl_def_id = self.tcx.hir().local_def_id(item.hir_id);
-            enforce_impl_params_are_constrained(self.tcx, impl_def_id, impl_item_refs);
-            enforce_impl_items_are_distinct(self.tcx, impl_item_refs);
+            enforce_impl_params_are_constrained(self.tcx, impl_def_id, items);
+            enforce_impl_items_are_distinct(self.tcx, items);
         }
     }