pub(super) lctx: &'a mut LoweringContext<'lowering, 'hir>,
}
-impl<'a, 'lowering, 'hir> ItemLowerer<'a, 'lowering, 'hir> {
- fn with_trait_impl_ref<F>(&mut self, trait_impl_ref: &Option<TraitRef>, f: F)
- where
- F: FnOnce(&mut Self),
- {
+impl ItemLowerer<'_, '_, '_> {
+ fn with_trait_impl_ref(&mut self, impl_ref: &Option<TraitRef>, f: impl FnOnce(&mut Self)) {
let old = self.lctx.is_in_trait_impl;
- self.lctx.is_in_trait_impl = if let &None = trait_impl_ref { false } else { true };
+ self.lctx.is_in_trait_impl = if let &None = impl_ref { false } else { true };
f(self);
self.lctx.is_in_trait_impl = old;
}
}
-impl<'a, 'lowering, 'hir> Visitor<'a> for ItemLowerer<'a, 'lowering, 'hir> {
+impl<'a> Visitor<'a> for ItemLowerer<'a, '_, '_> {
fn visit_mod(&mut self, m: &'a Mod, _s: Span, _attrs: &[Attribute], n: NodeId) {
let hir_id = self.lctx.lower_node_id(n);
self.lctx.with_parent_item_lifetime_defs(hir_id, |this| {
let this = &mut ItemLowerer { lctx: this };
if let ItemKind::Impl(.., ref opt_trait_ref, _, _) = item.kind {
+ if opt_trait_ref.as_ref().map(|tr| tr.constness.is_some()).unwrap_or(false) {
+ this.lctx
+ .diagnostic()
+ .span_err(item.span, "const trait impls are not yet implemented");
+ }
+
this.with_trait_impl_ref(opt_trait_ref, |this| visit::walk_item(this, item));
} else {
visit::walk_item(this, item);