-
-
Notifications
You must be signed in to change notification settings - Fork 170
uefi-macros: Require that the entry function takes zero args #1418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
phip1611
merged 3 commits into
rust-osdev:main
from
nicholasbishop:bishop-macros-cleanup
Oct 1, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
bbd7623
uefi-macros: Update error messages to use function instead of method
nicholasbishop b241fb7
uefi-macros: Remove use of deprecated types from most compilation tests
nicholasbishop 1c41f17
uefi-macros: Drop support for two-argument entry function
nicholasbishop File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
#![allow(deprecated)] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
extern "C" fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
extern "C" fn main() -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Entry method must have no ABI modifier | ||
--> tests/ui/fail/entry_bad_abi.rs:9:1 | ||
error: Entry function must have no ABI modifier | ||
--> tests/ui/fail/entry_bad_abi.rs:6:1 | ||
| | ||
9 | extern "C" fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
6 | extern "C" fn main() -> Status { | ||
| ^^^^^^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
#![allow(deprecated)] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
fn main(_handle: Handle, _st: SystemTable<Boot>, _x: usize) -> Status { | ||
fn main(_x: usize) -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
error[E0308]: mismatched types | ||
--> tests/ui/fail/entry_bad_arg.rs:9:1 | ||
error: Entry function must have no arguments | ||
--> tests/ui/fail/entry_bad_arg.rs:6:9 | ||
| | ||
9 | fn main(_handle: Handle, _st: SystemTable<Boot>, _x: usize) -> Status { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | ||
| | ||
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> uefi::Status` | ||
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>, usize) -> uefi::Status` | ||
6 | fn main(_x: usize) -> Status { | ||
| ^^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
async fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
async fn main() -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Entry method should not be async | ||
--> tests/ui/fail/entry_bad_async.rs:8:1 | ||
error: Entry function should not be async | ||
--> tests/ui/fail/entry_bad_async.rs:6:1 | ||
| | ||
8 | async fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
6 | async fn main() -> Status { | ||
| ^^^^^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry(some_arg)] | ||
fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
fn main() -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Entry attribute accepts no arguments | ||
--> tests/ui/fail/entry_bad_attr_arg.rs:7:9 | ||
--> tests/ui/fail/entry_bad_attr_arg.rs:5:9 | ||
| | ||
7 | #[entry(some_arg)] | ||
5 | #[entry(some_arg)] | ||
| ^^^^^^^^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
const fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
const fn main() -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Entry method should not be const | ||
--> tests/ui/fail/entry_bad_const.rs:8:1 | ||
error: Entry function should not be const | ||
--> tests/ui/fail/entry_bad_const.rs:6:1 | ||
| | ||
8 | const fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
6 | const fn main() -> Status { | ||
| ^^^^^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
fn main<T>(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
fn main<T>() -> Status { | ||
Status::SUCCESS | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error: Entry method should not be generic | ||
--> tests/ui/fail/entry_bad_generic.rs:8:9 | ||
error: Entry function should not be generic | ||
--> tests/ui/fail/entry_bad_generic.rs:6:9 | ||
| | ||
8 | fn main<T>(_handle: Handle, _st: SystemTable<Boot>) -> Status { | ||
6 | fn main<T>() -> Status { | ||
| ^ |
This file contains hidden or 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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
#![allow(unused_imports)] | ||
#![no_main] | ||
#![allow(deprecated)] | ||
|
||
use uefi::prelude::*; | ||
use uefi_macros::entry; | ||
|
||
#[entry] | ||
fn main(_handle: Handle, _st: SystemTable<Boot>) -> bool { | ||
fn main() -> bool { | ||
false | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error[E0308]: mismatched types | ||
--> tests/ui/fail/entry_bad_return_type.rs:9:1 | ||
--> tests/ui/fail/entry_bad_return_type.rs:6:1 | ||
| | ||
9 | fn main(_handle: Handle, _st: SystemTable<Boot>) -> bool { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Status`, found `bool` | ||
6 | fn main() -> bool { | ||
| ^^^^^^^^^^^^^^^^^ expected `Status`, found `bool` | ||
| | ||
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> Status` | ||
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> bool` | ||
= note: expected fn pointer `extern "efiapi" fn(Handle, *const c_void) -> Status` | ||
found fn pointer `extern "efiapi" fn(Handle, *const c_void) -> bool` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, thanks for working on this!
(I'm always happy if I do not have to write codegen code by myself.. its tricky 😀)