Migrate some rustc_builtin_macros to SessionDiagnostic

This commit is contained in:
He1pa 2023-06-21 19:01:53 +08:00
parent ed1ce580ec
commit 8af8a95a64
11 changed files with 134 additions and 32 deletions

View file

@ -576,12 +576,7 @@ fn check_bench_signature(
// N.B., inadequate check, but we're running
// well before resolve, can't get too deep.
if f.sig.decl.inputs.len() != 1 {
return Err(cx.sess.parse_sess.span_diagnostic.span_err(
i.span,
"functions used as benches must have \
signature `fn(&mut Bencher) -> impl Termination`",
));
return Err(cx.sess.parse_sess.span_diagnostic.emit_err(errors::BenchSig { span: i.span }));
}
Ok(())
}