Skip to content

Commit c16ff33

Browse files
uefi-raw: Require Debug impls
Note that this requires rust>=1.70 for deriving `Debug` on `efiapi` function pointers.
1 parent 8717f33 commit c16ff33

File tree

11 files changed

+16
-1
lines changed

11 files changed

+16
-1
lines changed

uefi-raw/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
1111
#![no_std]
1212
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
13+
#![deny(missing_debug_implementations)]
1314
#![deny(clippy::all)]
1415
#![deny(clippy::ptr_as_ptr, unused)]
1516
#![deny(clippy::must_use_candidate)]

uefi-raw/src/protocol/block.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ pub struct BlockIoMedia {
2626
pub optimal_transfer_length_granularity: u32,
2727
}
2828

29+
#[derive(Debug)]
2930
#[repr(C)]
3031
pub struct BlockIoProtocol {
3132
pub revision: u64,

uefi-raw/src/protocol/console.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub struct InputKey {
1010
pub unicode_char: Char16,
1111
}
1212

13+
#[derive(Debug)]
1314
#[repr(C)]
1415
pub struct SimpleTextInputProtocol {
1516
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: bool) -> Status,
@@ -32,6 +33,7 @@ pub struct SimpleTextOutputMode {
3233
pub cursor_visible: bool,
3334
}
3435

36+
#[derive(Debug)]
3537
#[repr(C)]
3638
pub struct SimpleTextOutputProtocol {
3739
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended: bool) -> Status,
@@ -76,6 +78,7 @@ pub struct SimplePointerState {
7678
pub right_button: u8,
7779
}
7880

81+
#[derive(Debug)]
7982
#[repr(C)]
8083
pub struct SimplePointerProtocol {
8184
pub reset: unsafe extern "efiapi" fn(
@@ -94,6 +97,7 @@ impl SimplePointerProtocol {
9497
pub const GUID: Guid = guid!("31878c87-0b75-11d5-9a4f-0090273fc14d");
9598
}
9699

100+
#[derive(Debug)]
97101
#[repr(C)]
98102
pub struct GraphicsOutputProtocol {
99103
pub query_mode: unsafe extern "efiapi" fn(

uefi-raw/src/protocol/console/serial.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub struct SerialIoMode {
7575
pub stop_bits: StopBits,
7676
}
7777

78+
#[derive(Debug)]
7879
#[repr(C)]
7980
pub struct SerialIoProtocol {
8081
pub revision: u32,

uefi-raw/src/protocol/disk.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::{guid, Event, Guid, Status};
22
use core::ffi::c_void;
33

4+
#[derive(Debug)]
45
#[repr(C)]
56
pub struct DiskIoProtocol {
67
pub revision: u64,
@@ -32,6 +33,7 @@ pub struct DiskIo2Token {
3233
pub transaction_status: Status,
3334
}
3435

36+
#[derive(Debug)]
3537
#[repr(C)]
3638
pub struct DiskIo2Protocol {
3739
pub revision: u64,

uefi-raw/src/protocol/driver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::{guid, Guid, Handle, Status};
22

3+
#[derive(Debug)]
34
#[repr(C)]
45
pub struct ComponentName2Protocol {
56
pub get_driver_name: unsafe extern "efiapi" fn(

uefi-raw/src/protocol/loaded_image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::table::system::SystemTable;
44
use crate::{guid, Guid, Handle, Status};
55
use core::ffi::c_void;
66

7-
#[derive(Clone, Copy)]
7+
#[derive(Clone, Copy, Debug)]
88
#[repr(C)]
99
pub struct LoadedImageProtocol {
1010
pub revision: u32,

uefi-raw/src/protocol/memory_protection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::table::boot::MemoryAttribute;
22
use crate::{guid, Guid, PhysicalAddress, Status};
33

4+
#[derive(Debug)]
45
#[repr(C)]
56
pub struct MemoryAttributeProtocol {
67
pub get_memory_attributes: unsafe extern "efiapi" fn(

uefi-raw/src/protocol/rng.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ newtype_enum! {
3333
}
3434

3535
/// Rng protocol.
36+
#[derive(Debug)]
3637
#[repr(C)]
3738
pub struct RngProtocol {
3839
pub get_info: unsafe extern "efiapi" fn(

uefi-raw/src/table/boot.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use bitflags::bitflags;
77
use core::ffi::c_void;
88

99
/// Table of pointers to all the boot services.
10+
#[derive(Debug)]
1011
#[repr(C)]
1112
pub struct BootServices {
1213
pub header: Header,
@@ -397,6 +398,7 @@ impl MemoryType {
397398
}
398399
}
399400

401+
#[derive(Debug)]
400402
#[repr(C)]
401403
pub struct OpenProtocolInformationEntry {
402404
pub agent_handle: Handle,

0 commit comments

Comments
 (0)