Forbid the use of #[target_feature]
on start
This commit is contained in:
parent
db26693982
commit
963305bda8
5 changed files with 39 additions and 0 deletions
|
@ -344,6 +344,15 @@ pub(crate) struct StartTrackCaller {
|
|||
pub start: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_start_not_target_feature)]
|
||||
pub(crate) struct StartTargetFeature {
|
||||
#[primary_span]
|
||||
pub span: Span,
|
||||
#[label]
|
||||
pub start: Span,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(hir_analysis_start_not_async, code = "E0752")]
|
||||
pub(crate) struct StartAsync {
|
||||
|
|
|
@ -378,6 +378,13 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: DefId) {
|
|||
});
|
||||
error = true;
|
||||
}
|
||||
if attr.has_name(sym::target_feature) {
|
||||
tcx.sess.emit_err(errors::StartTargetFeature {
|
||||
span: attr.span,
|
||||
start: start_span,
|
||||
});
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
|
||||
if error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue