forked from rust-osdev/uefi-rs
-
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.
Merge pull request rust-osdev#1418 from nicholasbishop/bishop-macros-…
…cleanup uefi-macros: Require that the entry function takes zero args
- Loading branch information
Showing
24 changed files
with
79 additions
and
217 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
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 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 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 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 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 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 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 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 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 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 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 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 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 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.