Skip to content

Commit

Permalink
Rollup merge of #108337 - tshepang:translatable-hir-analysis, r=cjgillot
Browse files Browse the repository at this point in the history
hir-analysis: make a helpful note
  • Loading branch information
matthiaskrgr authored Feb 26, 2023
2 parents 3d2319f + e5d1fcd commit b27f37d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/locales/en-US.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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]`
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_hir_analysis/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/rfc-2091-track-caller/error-with-main.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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]`

Expand Down

0 comments on commit b27f37d

Please sign in to comment.