File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
compiler/rustc_hir_analysis
tests/ui/rfc-2091-track-caller Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ hir_analysis_where_clause_on_main = `main` function is not allowed to have a `wh
131131 .label = `main` cannot have a `where` clause
132132
133133hir_analysis_track_caller_on_main = `main` function is not allowed to be `#[track_caller]`
134- .label = `main` function is not allowed to be `#[track_caller]`
134+ .suggestion = remove this annotation
135135
136136hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
137137 .label = `start` is not allowed to be `#[track_caller]`
Original file line number Diff line number Diff line change @@ -329,8 +329,9 @@ pub(crate) struct WhereClauseOnMain {
329329#[ diag( hir_analysis_track_caller_on_main) ]
330330pub ( crate ) struct TrackCallerOnMain {
331331 #[ primary_span]
332+ #[ suggestion( applicability = "maybe-incorrect" , code = "" ) ]
332333 pub span : Span ,
333- #[ label]
334+ #[ label( hir_analysis_track_caller_on_main ) ]
334335 pub annotated : Span ,
335336}
336337
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: `main` function is not allowed to be `#[track_caller]`
22 --> $DIR/error-with-main.rs:1:1
33 |
44LL | #[track_caller]
5- | ^^^^^^^^^^^^^^^
5+ | ^^^^^^^^^^^^^^^ help: remove this annotation
66LL | fn main() {
77 | --------- `main` function is not allowed to be `#[track_caller]`
88
You can’t perform that action at this time.
0 commit comments