File tree 3 files changed +4
-3
lines changed
compiler/rustc_hir_analysis
tests/ui/rfc-2091-track-caller
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
131
131
.label = `main` cannot have a `where` clause
132
132
133
133
hir_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
135
135
136
136
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
137
137
.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 {
329
329
#[ diag( hir_analysis_track_caller_on_main) ]
330
330
pub ( crate ) struct TrackCallerOnMain {
331
331
#[ primary_span]
332
+ #[ suggestion( applicability = "maybe-incorrect" , code = "" ) ]
332
333
pub span : Span ,
333
- #[ label]
334
+ #[ label( hir_analysis_track_caller_on_main ) ]
334
335
pub annotated : Span ,
335
336
}
336
337
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: `main` function is not allowed to be `#[track_caller]`
2
2
--> $DIR/error-with-main.rs:1:1
3
3
|
4
4
LL | #[track_caller]
5
- | ^^^^^^^^^^^^^^^
5
+ | ^^^^^^^^^^^^^^^ help: remove this annotation
6
6
LL | fn main() {
7
7
| --------- `main` function is not allowed to be `#[track_caller]`
8
8
You can’t perform that action at this time.
0 commit comments