hir-analysis: make one diagnostic translatable
This commit is contained in:
parent
3200982b76
commit
b483816d88
3 changed files with 13 additions and 4 deletions
|
@ -297,10 +297,7 @@ fn check_main_fn_ty(tcx: TyCtxt<'_>, main_def_id: DefId) {
|
|||
}
|
||||
|
||||
for attr in tcx.get_attrs(main_def_id, sym::track_caller) {
|
||||
tcx.sess
|
||||
.struct_span_err(attr.span, "`main` function is not allowed to be `#[track_caller]`")
|
||||
.span_label(main_span, "`main` function is not allowed to be `#[track_caller]`")
|
||||
.emit();
|
||||
tcx.sess.emit_err(errors::TrackCallerOnMain { span: attr.span, annotated: main_span });
|
||||
error = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue