Skip to content

Commit 952d660

Browse files
authored
Rollup merge of #116062 - eduardosm:start-fn-diag, r=WaffleLapkin
Change `start` to `#[start]` in some diagnosis They refer to a function with the `start` attribute, but not necessarily named `start`.
2 parents 81b98f6 + 17dfabf commit 952d660

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

compiler/rustc_error_codes/src/error_codes/E0647.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Erroneous code example:
77
88
#[start]
99
fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
10-
//^ error: start function is not allowed to have a where clause
10+
//^ error: `#[start]` function is not allowed to have a where clause
1111
0
1212
}
1313
```

compiler/rustc_hir_analysis/messages.ftl

+10-10
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,20 @@ hir_analysis_simd_ffi_highly_experimental = use of SIMD type{$snip} in FFI is hi
270270
hir_analysis_specialization_trait = implementing `rustc_specialization_trait` traits is unstable
271271
.help = add `#![feature(min_specialization)]` to the crate attributes to enable
272272
273-
hir_analysis_start_function_parameters = start function is not allowed to have type parameters
274-
.label = start function cannot have type parameters
273+
hir_analysis_start_function_parameters = `#[start]` function is not allowed to have type parameters
274+
.label = `#[start]` function cannot have type parameters
275275
276-
hir_analysis_start_function_where = start function is not allowed to have a `where` clause
277-
.label = start function cannot have a `where` clause
276+
hir_analysis_start_function_where = `#[start]` function is not allowed to have a `where` clause
277+
.label = `#[start]` function cannot have a `where` clause
278278
279-
hir_analysis_start_not_async = `start` is not allowed to be `async`
280-
.label = `start` is not allowed to be `async`
279+
hir_analysis_start_not_async = `#[start]` function is not allowed to be `async`
280+
.label = `#[start]` is not allowed to be `async`
281281
282-
hir_analysis_start_not_target_feature = `start` is not allowed to have `#[target_feature]`
283-
.label = `start` is not allowed to have `#[target_feature]`
282+
hir_analysis_start_not_target_feature = `#[start]` function is not allowed to have `#[target_feature]`
283+
.label = `#[start]` function is not allowed to have `#[target_feature]`
284284
285-
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]`
286-
.label = `start` is not allowed to be `#[track_caller]`
285+
hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]`
286+
.label = `#[start]` function is not allowed to be `#[track_caller]`
287287
288288
hir_analysis_static_specialize = cannot specialize on `'static` lifetime
289289

tests/ui/async-await/issue-68523-start.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
#[start]
66
pub async fn start(_: isize, _: *const *const u8) -> isize {
7-
//~^ ERROR `start` is not allowed to be `async`
7+
//~^ ERROR `#[start]` function is not allowed to be `async`
88
0
99
}

tests/ui/async-await/issue-68523-start.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0752]: `start` is not allowed to be `async`
1+
error[E0752]: `#[start]` function is not allowed to be `async`
22
--> $DIR/issue-68523-start.rs:6:1
33
|
44
LL | pub async fn start(_: isize, _: *const *const u8) -> isize {
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `start` is not allowed to be `async`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `#[start]` is not allowed to be `async`
66

77
error: aborting due to previous error
88

tests/ui/error-codes/E0132.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0132]: start function is not allowed to have type parameters
1+
error[E0132]: `#[start]` function is not allowed to have type parameters
22
--> $DIR/E0132.rs:4:5
33
|
44
LL | fn f< T >() {}
5-
| ^^^^^ start function cannot have type parameters
5+
| ^^^^^ `#[start]` function cannot have type parameters
66

77
error: aborting due to previous error
88

tests/ui/error-codes/E0647.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0647]: start function is not allowed to have a `where` clause
1+
error[E0647]: `#[start]` function is not allowed to have a `where` clause
22
--> $DIR/E0647.rs:7:50
33
|
44
LL | fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
5-
| ^^^^^^^^^^^^^^ start function cannot have a `where` clause
5+
| ^^^^^^^^^^^^^^ `#[start]` function cannot have a `where` clause
66

77
error: aborting due to previous error
88

tests/ui/issues/issue-50714-1.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0647]: start function is not allowed to have a `where` clause
1+
error[E0647]: `#[start]` function is not allowed to have a `where` clause
22
--> $DIR/issue-50714-1.rs:9:50
33
|
44
LL | fn start(_: isize, _: *const *const u8) -> isize where fn(&()): Eq {
5-
| ^^^^^^^^^^^^^^^^^ start function cannot have a `where` clause
5+
| ^^^^^^^^^^^^^^^^^ `#[start]` function cannot have a `where` clause
66

77
error: aborting due to previous error
88

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![feature(start)]
22

33
#[start]
4-
#[track_caller] //~ ERROR `start` is not allowed to be `#[track_caller]`
4+
#[track_caller] //~ ERROR `#[start]` function is not allowed to be `#[track_caller]`
55
fn start(_argc: isize, _argv: *const *const u8) -> isize {
66
panic!("{}: oh no", std::panic::Location::caller());
77
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error: `start` is not allowed to be `#[track_caller]`
1+
error: `#[start]` function is not allowed to be `#[track_caller]`
22
--> $DIR/error-with-start.rs:4:1
33
|
44
LL | #[track_caller]
55
| ^^^^^^^^^^^^^^^
66
LL | fn start(_argc: isize, _argv: *const *const u8) -> isize {
7-
| -------------------------------------------------------- `start` is not allowed to be `#[track_caller]`
7+
| -------------------------------------------------------- `#[start]` function is not allowed to be `#[track_caller]`
88

99
error: aborting due to previous error
1010

tests/ui/rfcs/rfc-2396-target_feature-11/issue-108645-target-feature-on-start.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
#[start]
77
#[target_feature(enable = "avx2")]
8-
//~^ ERROR `start` is not allowed to have `#[target_feature]`
8+
//~^ ERROR `#[start]` function is not allowed to have `#[target_feature]`
99
fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error: `start` is not allowed to have `#[target_feature]`
1+
error: `#[start]` function is not allowed to have `#[target_feature]`
22
--> $DIR/issue-108645-target-feature-on-start.rs:7:1
33
|
44
LL | #[target_feature(enable = "avx2")]
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
LL |
77
LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
8-
| -------------------------------------------------------- `start` is not allowed to have `#[target_feature]`
8+
| -------------------------------------------------------- `#[start]` function is not allowed to have `#[target_feature]`
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)