forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#106092 - asquared31415:start_lang_item_chec…
…ks, r=davidtwco Add checks for the signature of the `start` lang item Closes rust-lang#105963
- Loading branch information
Showing
17 changed files
with
404 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: parameter 2 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:75:38 | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: i8, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ^^ help: change the type from `i8` to `isize` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: parameter 3 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:89:52 | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: u8, _sigpipe: u8) -> isize { | ||
| ^^ help: change the type from `u8` to `*const *const u8` | ||
|
||
error: aborting due to previous error | ||
|
13 changes: 13 additions & 0 deletions
13
src/test/ui/lang-items/start_lang_item_args.argv_inner_ptr.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: parameter 3 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:82:52 | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const usize, _sigpipe: u8) -> isize { | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
| | ||
help: change the type from `*const *const usize` to `*const *const u8` | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ~~~~~~~~~~~~~~~~ | ||
|
||
error: aborting due to previous error | ||
|
13 changes: 13 additions & 0 deletions
13
src/test/ui/lang-items/start_lang_item_args.main_args.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: parameter 1 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:61:20 | ||
| | ||
LL | fn start<T>(_main: fn(i32) -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ^^^^^^^^^^^^ | ||
| | ||
help: change the type from `fn(i32) -> T` to `fn() -> T` | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ~~~~~~~~~ | ||
|
||
error: aborting due to previous error | ||
|
13 changes: 13 additions & 0 deletions
13
src/test/ui/lang-items/start_lang_item_args.main_ret.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: parameter 1 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:68:20 | ||
| | ||
LL | fn start<T>(_main: fn() -> u16, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ^^^^^^^^^^^ | ||
| | ||
help: change the type from `fn() -> u16` to `fn() -> T` | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ~~~~~~~~~ | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: parameter 1 of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:54:20 | ||
| | ||
LL | fn start<T>(_main: u64, _argc: isize, _argv: *const *const u8, _sigpipe: u8) -> isize { | ||
| ^^^ help: change the type from `u64` to `fn() -> T` | ||
|
||
error: aborting due to previous error | ||
|
11 changes: 11 additions & 0 deletions
11
src/test/ui/lang-items/start_lang_item_args.missing_all_args.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: incorrect number of parameters for the `start` lang item | ||
--> $DIR/start_lang_item_args.rs:15:1 | ||
| | ||
LL | fn start<T>() -> isize { | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `start` lang item should have four parameters, but found 0 | ||
= note: the `start` lang item should have the signature `fn(fn() -> T, isize, *const *const u8, u8) -> isize` | ||
|
||
error: aborting due to previous error | ||
|
8 changes: 8 additions & 0 deletions
8
src/test/ui/lang-items/start_lang_item_args.missing_ret.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: the return type of the `start` lang item is incorrect | ||
--> $DIR/start_lang_item_args.rs:29:84 | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8, _sigpipe: u8) {} | ||
| ^ help: change the type from `()` to `isize` | ||
|
||
error: aborting due to previous error | ||
|
11 changes: 11 additions & 0 deletions
11
src/test/ui/lang-items/start_lang_item_args.missing_sigpipe_arg.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error: incorrect number of parameters for the `start` lang item | ||
--> $DIR/start_lang_item_args.rs:22:1 | ||
| | ||
LL | fn start<T>(_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: the `start` lang item should have four parameters, but found 3 | ||
= note: the `start` lang item should have the signature `fn(fn() -> T, isize, *const *const u8, u8) -> isize` | ||
|
||
error: aborting due to previous error | ||
|
Oops, something went wrong.