This means the new syntax will always fail to compile, even when the
feature gate is enabled. These checks will be removed in a later PR
once the implementation is done.
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);
p: &PolyTraitRef,
mut itctx: ImplTraitContext<'_, 'hir>,
) -> hir::PolyTraitRef<'hir> {
+ if p.trait_ref.constness.is_some() {
+ self.diagnostic().span_err(p.span, "`?const` on trait bounds is not yet implemented");
+ }
+
let bound_generic_params = self.lower_generic_params(
&p.bound_generic_params,
&NodeMap::default(),