]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_ast_lowering/item.rs
Rollup merge of #68469 - ollie27:skip_count, r=sfackler
[rust.git] / src / librustc_ast_lowering / item.rs
index bcc40b0c9c9c93b54b9a7511a8bc59dbfbb6bd14..2025d0c1c8e342140794fb4097b650b272952133 100644 (file)
@@ -66,9 +66,8 @@ fn visit_item(&mut self, item: &'a Item) {
         if let Some(hir_id) = item_hir_id {
             self.lctx.with_parent_item_lifetime_defs(hir_id, |this| {
                 let this = &mut ItemLowerer { lctx: this };
-                if let ItemKind::Impl { ref of_trait, .. } = item.kind {
-                    if of_trait.as_ref().map(|tr| tr.constness.is_some()).unwrap_or(false) {
-                        this.with_trait_impl_ref(of_trait, |this| visit::walk_item(this, item));
+                if let ItemKind::Impl { constness, ref of_trait, .. } = item.kind {
+                    if constness == Constness::Const {
                         this.lctx
                             .diagnostic()
                             .span_err(item.span, "const trait impls are not yet implemented");
@@ -365,6 +364,7 @@ fn lower_item_kind(
                 unsafety,
                 polarity,
                 defaultness,
+                constness,
                 generics: ref ast_generics,
                 of_trait: ref trait_ref,
                 self_ty: ref ty,
@@ -421,6 +421,7 @@ fn lower_item_kind(
                     unsafety,
                     polarity,
                     defaultness: self.lower_defaultness(defaultness, true /* [1] */),
+                    constness,
                     generics,
                     of_trait: trait_ref,
                     self_ty: lowered_ty,