Skip to content

Commit bbd7623

Browse files
uefi-macros: Update error messages to use function instead of method
Minor cleanup; a method usually refers to a function in an impl, not a free-standing function like `main`.
1 parent f1af600 commit bbd7623

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

uefi-macros/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn get_function_arg_name(f: &ItemFn, arg_index: usize, errors: &mut TokenStream2
103103
// The argument is unnamed, i.e. `_`.
104104
errors.append_all(err!(
105105
arg.pat.span(),
106-
"Entry method's arguments must be named"
106+
"Entry function's arguments must be named"
107107
));
108108
None
109109
}
@@ -181,18 +181,18 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
181181
let mut f = parse_macro_input!(input as ItemFn);
182182

183183
if let Some(ref abi) = f.sig.abi {
184-
errors.append_all(err!(abi, "Entry method must have no ABI modifier"));
184+
errors.append_all(err!(abi, "Entry function must have no ABI modifier"));
185185
}
186186
if let Some(asyncness) = f.sig.asyncness {
187-
errors.append_all(err!(asyncness, "Entry method should not be async"));
187+
errors.append_all(err!(asyncness, "Entry function should not be async"));
188188
}
189189
if let Some(constness) = f.sig.constness {
190-
errors.append_all(err!(constness, "Entry method should not be const"));
190+
errors.append_all(err!(constness, "Entry function should not be const"));
191191
}
192192
if !f.sig.generics.params.is_empty() {
193193
errors.append_all(err!(
194194
f.sig.generics.params,
195-
"Entry method should not be generic"
195+
"Entry function should not be generic"
196196
));
197197
}
198198

uefi-macros/tests/ui/fail/entry_bad_abi.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method must have no ABI modifier
1+
error: Entry function must have no ABI modifier
22
--> tests/ui/fail/entry_bad_abi.rs:9:1
33
|
44
9 | extern "C" fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status {

uefi-macros/tests/ui/fail/entry_bad_async.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method should not be async
1+
error: Entry function should not be async
22
--> tests/ui/fail/entry_bad_async.rs:8:1
33
|
44
8 | async fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status {

uefi-macros/tests/ui/fail/entry_bad_const.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method should not be const
1+
error: Entry function should not be const
22
--> tests/ui/fail/entry_bad_const.rs:8:1
33
|
44
8 | const fn main(_handle: Handle, _st: SystemTable<Boot>) -> Status {

uefi-macros/tests/ui/fail/entry_bad_generic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method should not be generic
1+
error: Entry function should not be generic
22
--> tests/ui/fail/entry_bad_generic.rs:8:9
33
|
44
8 | fn main<T>(_handle: Handle, _st: SystemTable<Boot>) -> Status {

uefi-macros/tests/ui/fail/entry_unnamed_image_arg.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method's arguments must be named
1+
error: Entry function's arguments must be named
22
--> tests/ui/fail/entry_unnamed_image_arg.rs:8:22
33
|
44
8 | fn unnamed_image_arg(_: Handle, _st: SystemTable<Boot>) -> Status {

uefi-macros/tests/ui/fail/entry_unnamed_table_arg.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: Entry method's arguments must be named
1+
error: Entry function's arguments must be named
22
--> tests/ui/fail/entry_unnamed_table_arg.rs:8:38
33
|
44
8 | fn unnamed_table_arg(_image: Handle, _: SystemTable<Boot>) -> Status {

0 commit comments

Comments
 (0)