Skip to content

Commit 1dde973

Browse files
Merge pull request #851 from nicholasbishop/bishop-auto-dbg
Derive `Debug` in more places (requires Rust 1.70)
2 parents ddc98f9 + 2c2f798 commit 1dde973

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+55
-206
lines changed

.github/workflows/msrv_toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.68"
2+
channel = "1.70"
33
targets = ["aarch64-unknown-uefi", "i686-unknown-uefi", "x86_64-unknown-uefi"]

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## uefi - [Unreleased]
44

55
### Changed
6+
- MSRV bumped to 1.70.
67
- `Input::wait_for_key_event` now returns an `Option<Event>`, and is no longer `const`.
78
- `Protocol::wait_for_input_event` now returns an `Option<Event>`, and is no longer `const`.
89
- `LoadedImage::device` now returns an `Option<Handle>` and is no longer `const`.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ edition = "2021"
1717
keywords = ["uefi", "efi"]
1818
license = "MPL-2.0"
1919
repository = "https://github.com/rust-osdev/uefi-rs"
20-
rust-version = "1.68"
20+
rust-version = "1.70"
2121

2222
[workspace.dependencies]
2323
bitflags = "2.0.0"

uefi-macros/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ pub fn unsafe_protocol(args: TokenStream, input: TokenStream) -> TokenStream {
8282
let (impl_generics, ty_generics, where_clause) = item_struct.generics.split_for_impl();
8383

8484
quote! {
85-
// Disable this lint for now. It doesn't account for the fact that
86-
// currently it doesn't work to `derive(Debug)` on structs that have
87-
// `extern "efiapi" fn` fields, which most protocol structs have. The
88-
// derive _does_ work in current nightly (1.70.0) though, so hopefully
89-
// in a couple Rust releases we can drop this.
90-
#[allow(missing_debug_implementations)]
9185
#item_struct
9286

9387
unsafe impl #impl_generics ::uefi::Identify for #ident #ty_generics #where_clause {

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(

0 commit comments

Comments
 (0)