hir-analysis: make a helpful note
This commit is contained in:
parent
31448badfd
commit
e5d1fcd535
3 changed files with 4 additions and 3 deletions
|
@ -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
|
.label = `main` cannot have a `where` clause
|
||||||
|
|
||||||
hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]`
|
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]`
|
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
|
||||||
.label = `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)]
|
#[diag(hir_analysis_track_caller_on_main)]
|
||||||
pub(crate) struct TrackCallerOnMain {
|
pub(crate) struct TrackCallerOnMain {
|
||||||
#[primary_span]
|
#[primary_span]
|
||||||
|
#[suggestion(applicability = "maybe-incorrect", code = "")]
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
#[label]
|
#[label(hir_analysis_track_caller_on_main)]
|
||||||
pub annotated: Span,
|
pub annotated: Span,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ error: `main` function is not allowed to be `#[track_caller]`
|
||||||
--> $DIR/error-with-main.rs:1:1
|
--> $DIR/error-with-main.rs:1:1
|
||||||
|
|
|
|
||||||
LL | #[track_caller]
|
LL | #[track_caller]
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^ help: remove this annotation
|
||||||
LL | fn main() {
|
LL | fn main() {
|
||||||
| --------- `main` function is not allowed to be `#[track_caller]`
|
| --------- `main` function is not allowed to be `#[track_caller]`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue