1
Fork 0

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`.
This commit is contained in:
Matthias Krüger 2023-09-22 23:12:37 +02:00 committed by GitHub
commit 952d6608fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 26 additions and 26 deletions

View file

@ -7,7 +7,7 @@ Erroneous code example:
#[start] #[start]
fn start(_: isize, _: *const *const u8) -> isize where (): Copy { fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
//^ error: start function is not allowed to have a where clause //^ error: `#[start]` function is not allowed to have a where clause
0 0
} }
``` ```

View file

@ -270,20 +270,20 @@ hir_analysis_simd_ffi_highly_experimental = use of SIMD type{$snip} in FFI is hi
hir_analysis_specialization_trait = implementing `rustc_specialization_trait` traits is unstable hir_analysis_specialization_trait = implementing `rustc_specialization_trait` traits is unstable
.help = add `#![feature(min_specialization)]` to the crate attributes to enable .help = add `#![feature(min_specialization)]` to the crate attributes to enable
hir_analysis_start_function_parameters = start function is not allowed to have type parameters hir_analysis_start_function_parameters = `#[start]` function is not allowed to have type parameters
.label = start function cannot have type parameters .label = `#[start]` function cannot have type parameters
hir_analysis_start_function_where = start function is not allowed to have a `where` clause hir_analysis_start_function_where = `#[start]` function is not allowed to have a `where` clause
.label = start function cannot have a `where` clause .label = `#[start]` function cannot have a `where` clause
hir_analysis_start_not_async = `start` is not allowed to be `async` hir_analysis_start_not_async = `#[start]` function is not allowed to be `async`
.label = `start` is not allowed to be `async` .label = `#[start]` is not allowed to be `async`
hir_analysis_start_not_target_feature = `start` is not allowed to have `#[target_feature]` hir_analysis_start_not_target_feature = `#[start]` function is not allowed to have `#[target_feature]`
.label = `start` is not allowed to have `#[target_feature]` .label = `#[start]` function is not allowed to have `#[target_feature]`
hir_analysis_start_not_track_caller = `start` is not allowed to be `#[track_caller]` hir_analysis_start_not_track_caller = `#[start]` function is not allowed to be `#[track_caller]`
.label = `start` is not allowed to be `#[track_caller]` .label = `#[start]` function is not allowed to be `#[track_caller]`
hir_analysis_static_specialize = cannot specialize on `'static` lifetime hir_analysis_static_specialize = cannot specialize on `'static` lifetime

View file

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

View file

@ -1,8 +1,8 @@
error[E0752]: `start` is not allowed to be `async` error[E0752]: `#[start]` function is not allowed to be `async`
--> $DIR/issue-68523-start.rs:6:1 --> $DIR/issue-68523-start.rs:6:1
| |
LL | pub async fn start(_: isize, _: *const *const u8) -> isize { LL | pub async fn start(_: isize, _: *const *const u8) -> isize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `start` is not allowed to be `async` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `#[start]` is not allowed to be `async`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0132]: start function is not allowed to have type parameters error[E0132]: `#[start]` function is not allowed to have type parameters
--> $DIR/E0132.rs:4:5 --> $DIR/E0132.rs:4:5
| |
LL | fn f< T >() {} LL | fn f< T >() {}
| ^^^^^ start function cannot have type parameters | ^^^^^ `#[start]` function cannot have type parameters
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0647]: start function is not allowed to have a `where` clause error[E0647]: `#[start]` function is not allowed to have a `where` clause
--> $DIR/E0647.rs:7:50 --> $DIR/E0647.rs:7:50
| |
LL | fn start(_: isize, _: *const *const u8) -> isize where (): Copy { LL | fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
| ^^^^^^^^^^^^^^ start function cannot have a `where` clause | ^^^^^^^^^^^^^^ `#[start]` function cannot have a `where` clause
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error[E0647]: start function is not allowed to have a `where` clause error[E0647]: `#[start]` function is not allowed to have a `where` clause
--> $DIR/issue-50714-1.rs:9:50 --> $DIR/issue-50714-1.rs:9:50
| |
LL | fn start(_: isize, _: *const *const u8) -> isize where fn(&()): Eq { LL | fn start(_: isize, _: *const *const u8) -> isize where fn(&()): Eq {
| ^^^^^^^^^^^^^^^^^ start function cannot have a `where` clause | ^^^^^^^^^^^^^^^^^ `#[start]` function cannot have a `where` clause
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,7 +1,7 @@
#![feature(start)] #![feature(start)]
#[start] #[start]
#[track_caller] //~ ERROR `start` is not allowed to be `#[track_caller]` #[track_caller] //~ ERROR `#[start]` function is not allowed to be `#[track_caller]`
fn start(_argc: isize, _argv: *const *const u8) -> isize { fn start(_argc: isize, _argv: *const *const u8) -> isize {
panic!("{}: oh no", std::panic::Location::caller()); panic!("{}: oh no", std::panic::Location::caller());
} }

View file

@ -1,10 +1,10 @@
error: `start` is not allowed to be `#[track_caller]` error: `#[start]` function is not allowed to be `#[track_caller]`
--> $DIR/error-with-start.rs:4:1 --> $DIR/error-with-start.rs:4:1
| |
LL | #[track_caller] LL | #[track_caller]
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { LL | fn start(_argc: isize, _argv: *const *const u8) -> isize {
| -------------------------------------------------------- `start` is not allowed to be `#[track_caller]` | -------------------------------------------------------- `#[start]` function is not allowed to be `#[track_caller]`
error: aborting due to previous error error: aborting due to previous error

View file

@ -5,5 +5,5 @@
#[start] #[start]
#[target_feature(enable = "avx2")] #[target_feature(enable = "avx2")]
//~^ ERROR `start` is not allowed to have `#[target_feature]` //~^ ERROR `#[start]` function is not allowed to have `#[target_feature]`
fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 } fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }

View file

@ -1,11 +1,11 @@
error: `start` is not allowed to have `#[target_feature]` error: `#[start]` function is not allowed to have `#[target_feature]`
--> $DIR/issue-108645-target-feature-on-start.rs:7:1 --> $DIR/issue-108645-target-feature-on-start.rs:7:1
| |
LL | #[target_feature(enable = "avx2")] LL | #[target_feature(enable = "avx2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | LL |
LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 } LL | fn start(_argc: isize, _argv: *const *const u8) -> isize { 0 }
| -------------------------------------------------------- `start` is not allowed to have `#[target_feature]` | -------------------------------------------------------- `#[start]` function is not allowed to have `#[target_feature]`
error: aborting due to previous error error: aborting due to previous error