Skip to content

Commit 54f7fa2

Browse files
authored
Merge pull request #1251 from phip1611/mem-module
uefi: mem: mem.rs -> mem/mod.rs
2 parents d077cc6 + ef3dcb6 commit 54f7fa2

File tree

5 files changed

+30
-34
lines changed

5 files changed

+30
-34
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error[E0308]: mismatched types
44
8 | fn main(_handle: Handle, _st: SystemTable<Boot>, _x: usize) -> Status {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters
66
|
7-
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot>) -> uefi::Status`
8-
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot>, usize) -> uefi::Status`
7+
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> uefi::Status`
8+
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>, usize) -> uefi::Status`

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ error[E0308]: mismatched types
44
8 | fn main(_handle: Handle, _st: SystemTable<Boot>) -> bool {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Status`, found `bool`
66
|
7-
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot>) -> Status`
8-
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::table::SystemTable<uefi::table::Boot>) -> bool`
7+
= note: expected fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> Status`
8+
found fn pointer `extern "efiapi" fn(uefi::Handle, uefi::prelude::SystemTable<uefi::prelude::Boot>) -> bool`

uefi/src/lib.rs

+18-30
Original file line numberDiff line numberDiff line change
@@ -95,50 +95,38 @@
9595

9696
#[cfg(feature = "alloc")]
9797
extern crate alloc;
98-
9998
// allow referring to self as ::uefi for macros to work universally (from this crate and from others)
10099
// see https://github.com/rust-lang/rust/issues/54647
101100
extern crate self as uefi;
102-
103-
/// Re-export ucs2_cstr so that it can be used in the implementation of the
104-
/// cstr16 macro. It is hidden since it's not intended to be used directly.
105-
#[doc(hidden)]
106-
pub use ucs2::ucs2_cstr;
107-
108101
#[macro_use]
109102
extern crate uefi_raw;
110103

111104
#[macro_use]
112105
pub mod data_types;
106+
pub mod allocator;
113107
#[cfg(feature = "alloc")]
114-
pub use data_types::CString16;
115-
pub use data_types::{CStr16, CStr8, Char16, Char8, Event, Guid, Handle, Identify};
116-
pub use uefi_macros::entry;
117-
pub use uguid::guid;
118-
119-
mod result;
120-
pub use result::{Error, Result, ResultExt, Status, StatusExt};
121-
108+
pub mod fs;
109+
pub mod helpers;
110+
pub mod mem;
111+
pub mod prelude;
112+
pub mod proto;
122113
pub mod runtime;
123114
pub mod system;
124115
pub mod table;
125116

126-
pub mod proto;
127-
128-
pub mod prelude;
129-
130-
pub mod allocator;
131-
132-
#[cfg(feature = "alloc")]
133-
pub mod fs;
134-
135-
// As long as this is behind "alloc", we can simplify cfg-feature attributes in this module.
136-
#[cfg(feature = "alloc")]
137-
pub(crate) mod mem;
138-
139117
pub(crate) mod polyfill;
140118

141-
pub mod helpers;
142-
143119
mod macros;
120+
mod result;
144121
mod util;
122+
123+
#[cfg(feature = "alloc")]
124+
pub use data_types::CString16;
125+
pub use data_types::{CStr16, CStr8, Char16, Char8, Event, Guid, Handle, Identify};
126+
pub use result::{Error, Result, ResultExt, Status, StatusExt};
127+
/// Re-export ucs2_cstr so that it can be used in the implementation of the
128+
/// cstr16 macro. It is hidden since it's not intended to be used directly.
129+
#[doc(hidden)]
130+
pub use ucs2::ucs2_cstr;
131+
pub use uefi_macros::entry;
132+
pub use uguid::guid;

uefi/src/mem/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//! Types, functions, traits, and other helpers to work with memory in UEFI
2+
//! libraries and applications.
3+
4+
#[cfg(feature = "alloc")]
5+
pub(crate) mod util;
6+
7+
#[cfg(feature = "alloc")]
8+
pub(crate) use util::*;
File renamed without changes.

0 commit comments

Comments
 (0)