Split diagnostic details out into a separate function and fluent files

This commit is contained in:
Oli Scherer
2022-10-25 18:28:04 +00:00
parent 8286ea5a49
commit 1c26a278f3
4 changed files with 57 additions and 26 deletions

View File

@@ -539,10 +539,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
if let Some(ty::BoundConstness::ConstIfConst) = constness
&& generics.has_self && !tcx.has_attr(def_id, sym::const_trait)
{
tcx.sess.span_err(
span,
"~const can only be applied to `#[const_trait]` traits",
);
tcx.sess.emit_err(crate::errors::ConstBoundForNonConstTrait { span } );
}
(substs, arg_count)