hir-analysis: make a helpful note
This commit is contained in:
parent
31448badfd
commit
e5d1fcd535
@ -131,7 +131,7 @@ hir_analysis_where_clause_on_main = `main` function is not allowed to have a `wh
|
||||
.label = `main` cannot have a `where` clause
|
||||
|
||||
hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]`
|
||||
.label = `main` function is not allowed to be `#[track_caller]`
|
||||
.suggestion = remove this annotation
|
||||
|
||||
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
|
||||
.label = `start` is not allowed to be `#[track_caller]`
|
||||
|
@ -329,8 +329,9 @@ pub(crate) struct WhereClauseOnMain {
|
||||
#[diag(hir_analysis_track_caller_on_main)]
|
||||
pub(crate) struct TrackCallerOnMain {
|
||||
#[primary_span]
|
||||
#[suggestion(applicability = "maybe-incorrect", code = "")]
|
||||
pub span: Span,
|
||||
#[label]
|
||||
#[label(hir_analysis_track_caller_on_main)]
|
||||
pub annotated: Span,
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ error: `main` function is not allowed to be `#[track_caller]`
|
||||
--> $DIR/error-with-main.rs:1:1
|
||||
|
|
||||
LL | #[track_caller]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^ help: remove this annotation
|
||||
LL | fn main() {
|
||||
| --------- `main` function is not allowed to be `#[track_caller]`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user