Skip to content

Commit 8ecb54d

Browse files
Merge pull request #1586 from phip1611/edition-2024
rust: edition 2024
2 parents 7ff771e + 6eac8c1 commit 8ecb54d

File tree

127 files changed

+372
-320
lines changed

Some content is hidden

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

127 files changed

+372
-320
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ members = [
1313
[workspace.package]
1414
authors = ["The Rust OSDev team"]
1515
categories = ["embedded", "no-std", "api-bindings"]
16-
edition = "2021"
16+
edition = "2024"
1717
keywords = ["uefi", "efi"]
1818
license = "MIT OR Apache-2.0"
1919
repository = "https://github.com/rust-osdev/uefi-rs"
20-
rust-version = "1.81"
20+
rust-version = "1.85.1"
2121

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

rustfmt.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# We keep this file explicitley to ensure that direct invocations of `rustfmt`
2+
# also use the proper style edition. Unlike `cargo fmt`, which forwards the
3+
# Rust edition specified in Cargo.toml to `rustfmt`, `rustfmt` still defaults to
4+
# the 2021 edition and is unaware of `Cargo.toml`.
5+
#
6+
# We use a direct invocation of `rustfmt` in our device path generation code.
7+
8+
style_edition = "2024"

template/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "uefi_app"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55
publish = false
66

77
[dependencies]

uefi-macros/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# uefi-macros - [Unreleased]
22

3+
## Changed
4+
5+
- **Breaking:** The MSRV is now 1.85.1 and the crate uses the Rust 2024 edition.
36

47
# uefi-macros - 0.18.1 (2025-05-04)
58

uefi-macros/src/lib.rs

+8-11
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ extern crate proc_macro;
77
use proc_macro::TokenStream;
88

99
use proc_macro2::TokenStream as TokenStream2;
10-
use quote::{quote, quote_spanned, TokenStreamExt};
10+
use quote::{TokenStreamExt, quote, quote_spanned};
1111
use syn::spanned::Spanned;
1212
use syn::{
13-
parse_macro_input, parse_quote, parse_quote_spanned, Error, Expr, ExprLit, ExprPath, ItemFn,
14-
ItemStruct, Lit, Visibility,
13+
Error, Expr, ExprLit, ExprPath, ItemFn, ItemStruct, Lit, Visibility, parse_macro_input,
14+
parse_quote, parse_quote_spanned,
1515
};
1616

1717
macro_rules! err {
@@ -69,13 +69,10 @@ pub fn unsafe_protocol(args: TokenStream, input: TokenStream) -> TokenStream {
6969
quote!(::uefi::guid!(#lit))
7070
}
7171
Expr::Path(ExprPath { path, .. }) => quote!(#path),
72-
_ => {
73-
return err!(
74-
expr,
75-
"macro input must be either a string literal or path to a constant"
76-
)
77-
.into()
78-
}
72+
_ => err!(
73+
expr,
74+
"macro input must be either a string literal or path to a constant"
75+
),
7976
};
8077

8178
let item_struct = parse_macro_input!(input as ItemStruct);
@@ -215,7 +212,7 @@ pub fn entry(args: TokenStream, input: TokenStream) -> TokenStream {
215212
let result = quote! {
216213
#fn_type_check
217214

218-
#[export_name = "efi_main"]
215+
#[unsafe(export_name = "efi_main")]
219216
#f
220217

221218
};

uefi-raw/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
- `DevicePathProtocol` now derives
2424
`Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash`
2525

26+
## Changed
27+
28+
- **Breaking:** The MSRV is now 1.85.1 and the crate uses the Rust 2024 edition.
29+
2630

2731
# uefi-raw - 0.10.0 (2025-02-07)
2832

uefi-raw/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ license.workspace = true
1616
repository.workspace = true
1717
# uefi-raw is much less likely to need the latest bleeding-edge features.
1818
# Hence, it is okay to not use the workspace MSRV.
19-
rust-version = "1.77"
19+
rust-version = "1.85.1"
2020

2121
[dependencies]
2222
bitflags.workspace = true

uefi-raw/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub mod time;
3434
mod status;
3535

3636
pub use status::Status;
37-
pub use uguid::{guid, Guid};
37+
pub use uguid::{Guid, guid};
3838

3939
use core::ffi::c_void;
4040
use core::fmt::{self, Debug, Formatter};

uefi-raw/src/protocol/ata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use super::device_path::DevicePathProtocol;
44
use crate::{Event, Status};
55
use core::ffi::c_void;
6-
use uguid::{guid, Guid};
6+
use uguid::{Guid, guid};
77

88
bitflags::bitflags! {
99
/// ATA Controller attributes.

uefi-raw/src/protocol/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Guid, Status};
3+
use crate::{Boolean, Guid, Status, guid};
44
use core::ffi::c_void;
55

66
/// Logical block address.

uefi-raw/src/protocol/console.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pub mod serial;
44

5-
use crate::{guid, Boolean, Char16, Event, Guid, PhysicalAddress, Status};
5+
use crate::{Boolean, Char16, Event, Guid, PhysicalAddress, Status, guid};
66
use bitflags::bitflags;
77
use core::ptr;
88

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Guid, Status};
3+
use crate::{Guid, Status, guid};
44
use bitflags::bitflags;
55

66
bitflags! {

uefi-raw/src/protocol/device_path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
mod device_path_gen;
44

5-
use crate::{guid, Boolean, Char16, Guid};
5+
use crate::{Boolean, Char16, Guid, guid};
66

77
pub use device_path_gen::{acpi, bios_boot_spec, end, hardware, media, messaging};
88

uefi-raw/src/protocol/device_path/device_path_gen.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![allow(missing_debug_implementations)]
1111
use crate::protocol::device_path;
1212
use crate::table::boot::MemoryType;
13-
use crate::{guid, Guid, IpAddress};
13+
use crate::{Guid, IpAddress, guid};
1414
use bitflags::bitflags;
1515
use device_path::DevicePathProtocol as DevicePathHeader;
1616
#[cfg(doc)]

uefi-raw/src/protocol/disk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Event, Guid, Status};
3+
use crate::{Event, Guid, Status, guid};
44
use core::ffi::c_void;
55

66
#[derive(Debug)]

uefi-raw/src/protocol/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::device_path::DevicePathProtocol;
4-
use crate::{guid, Guid, Handle, Status};
4+
use crate::{Guid, Handle, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

uefi-raw/src/protocol/file_system.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::time::Time;
4-
use crate::{guid, Boolean, Char16, Event, Guid, Status};
4+
use crate::{Boolean, Char16, Event, Guid, Status, guid};
55
use bitflags::bitflags;
66
use core::ffi::c_void;
77

uefi-raw/src/protocol/firmware_volume.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use crate::firmware_storage::FirmwareVolumeAttributes;
44
use crate::protocol::block::Lba;
5-
use crate::{guid, Guid, Handle, PhysicalAddress, Status};
5+
use crate::{Guid, Handle, PhysicalAddress, Status, guid};
66
use core::ffi::c_void;
77
use core::ops::RangeInclusive;
88

uefi-raw/src/protocol/hii/database.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Bindings for HII Database Protocol
44
55
use super::{HiiHandle, HiiPackageHeader, HiiPackageListHeader, KeyDescriptor};
6-
use crate::{guid, Guid, Handle, Status};
6+
use crate::{Guid, Handle, Status, guid};
77

88
/// EFI_HII_KEYBOARD_LAYOUT
99
#[derive(Debug)]

uefi-raw/src/protocol/loaded_image.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::protocol::device_path::DevicePathProtocol;
44
use crate::table::boot::MemoryType;
55
use crate::table::system::SystemTable;
6-
use crate::{guid, Guid, Handle, Status};
6+
use crate::{Guid, Handle, Status, guid};
77
use core::ffi::c_void;
88

99
#[derive(Clone, Copy, Debug)]

uefi-raw/src/protocol/media.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::device_path::DevicePathProtocol;
4-
use crate::{guid, Boolean, Guid, Status};
4+
use crate::{Boolean, Guid, Status, guid};
55
use core::ffi::c_void;
66

77
#[derive(Debug)]

uefi-raw/src/protocol/memory_protection.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::table::boot::MemoryAttribute;
4-
use crate::{guid, Guid, PhysicalAddress, Status};
4+
use crate::{Guid, PhysicalAddress, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

uefi-raw/src/protocol/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::table::runtime;
4-
use crate::{guid, Guid, Status};
4+
use crate::{Guid, Status, guid};
55

66
#[derive(Debug)]
77
#[repr(C)]

uefi-raw/src/protocol/network/dhcp4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char8, Event, Guid, Ipv4Address, MacAddress, Status};
3+
use crate::{Boolean, Char8, Event, Guid, Ipv4Address, MacAddress, Status, guid};
44
use core::ffi::c_void;
55

66
newtype_enum! {

uefi-raw/src/protocol/network/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char16, Char8, Event, Guid, Ipv4Address, Ipv6Address, Status};
3+
use crate::{Boolean, Char8, Char16, Event, Guid, Ipv4Address, Ipv6Address, Status, guid};
44
use core::ffi::c_void;
55
use core::fmt::{self, Debug, Formatter};
66
use core::ptr;

uefi-raw/src/protocol/network/ip4_config2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::network::ip4::Ip4RouteTable;
4-
use crate::{guid, Char16, Event, Guid, Ipv4Address, MacAddress, Status};
4+
use crate::{Char16, Event, Guid, Ipv4Address, MacAddress, Status, guid};
55
use core::ffi::c_void;
66

77
newtype_enum! {

uefi-raw/src/protocol/network/pxe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Boolean, Char8, Guid, IpAddress, MacAddress, Status};
3+
use crate::{Boolean, Char8, Guid, IpAddress, MacAddress, Status, guid};
44
use bitflags::bitflags;
55
use core::ffi::c_void;
66
use core::fmt::{self, Debug, Formatter};

uefi-raw/src/protocol/network/snp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::ffi;
44

55
use bitflags::bitflags;
66

7-
use crate::{guid, Boolean, Event, Guid, IpAddress, MacAddress, Status};
7+
use crate::{Boolean, Event, Guid, IpAddress, MacAddress, Status, guid};
88

99
#[derive(Debug)]
1010
#[repr(C)]

uefi-raw/src/protocol/network/tls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Guid, Status};
3+
use crate::{Guid, Status, guid};
44
use core::ffi::c_void;
55

66
newtype_enum! {

uefi-raw/src/protocol/nvme.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use super::device_path::DevicePathProtocol;
44
use crate::Status;
55
use core::ffi::c_void;
6-
use uguid::{guid, Guid};
6+
use uguid::{Guid, guid};
77

88
bitflags::bitflags! {
99
/// In an NVMe command, the `flags` field specifies which cdw (command specific word)

uefi-raw/src/protocol/rng.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//! `Rng` protocol.
44
5-
use crate::{guid, Guid, Status};
5+
use crate::{Guid, Status, guid};
66

77
newtype_enum! {
88
/// The algorithms listed are optional, not meant to be exhaustive

uefi-raw/src/protocol/scsi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use super::device_path::DevicePathProtocol;
4-
use crate::{guid, Event, Guid, Status};
4+
use crate::{Event, Guid, Status, guid};
55
use core::ffi::c_void;
66

77
pub const SCSI_TARGET_MAX_BYTES: usize = 0x10;

uefi-raw/src/protocol/shell_params.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char16, Guid};
3+
use crate::{Char16, Guid, guid};
44
use core::ffi::c_void;
55

66
pub type ShellFileHandle = *const c_void;

uefi-raw/src/protocol/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char16, Char8, Guid};
3+
use crate::{Char8, Char16, Guid, guid};
44

55
#[derive(Debug)]
66
#[repr(C)]

uefi-raw/src/protocol/tcg/v1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//! [TCG]: https://trustedcomputinggroup.org/
1111
//! [TPM]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
1212
13-
use crate::{guid, Guid, PhysicalAddress, Status};
13+
use crate::{Guid, PhysicalAddress, Status, guid};
1414
use core::ffi::c_void;
1515

1616
/// Information about the protocol and the TPM device.

uefi-raw/src/protocol/tcg/v2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! [TPM]: https://en.wikipedia.org/wiki/Trusted_Platform_Module
1414
1515
use super::EventType;
16-
use crate::{guid, Guid, PhysicalAddress, Status};
16+
use crate::{Guid, PhysicalAddress, Status, guid};
1717
use bitflags::bitflags;
1818
use core::ffi::c_void;
1919

uefi-raw/src/protocol/usb/host_controller.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::ffi;
44

55
use bitflags::bitflags;
66

7-
use crate::{guid, Boolean, Guid, Status};
7+
use crate::{Boolean, Guid, Status, guid};
88

99
use super::{AsyncUsbTransferCallback, DataDirection, DeviceRequest, UsbTransferStatus};
1010

uefi-raw/src/protocol/usb/io.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use core::ffi;
44

5-
use crate::{guid, Boolean, Char16, Guid, Status};
5+
use crate::{Boolean, Char16, Guid, Status, guid};
66

77
use super::{
88
AsyncUsbTransferCallback, ConfigDescriptor, DataDirection, DeviceDescriptor, DeviceRequest,

uefi-raw/src/table/runtime.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
//! UEFI services available at runtime, even after the OS boots.
44
55
use crate::capsule::CapsuleHeader;
6-
use crate::table::boot::MemoryDescriptor;
76
use crate::table::Header;
7+
use crate::table::boot::MemoryDescriptor;
88
use crate::time::Time;
9-
use crate::{guid, Boolean, Char16, Guid, PhysicalAddress, Status};
9+
use crate::{Boolean, Char16, Guid, PhysicalAddress, Status, guid};
1010
use bitflags::bitflags;
1111
use core::ffi::c_void;
1212

uefi-raw/src/table/system.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::console::{SimpleTextInputProtocol, SimpleTextOutputProtocol};
4+
use crate::table::Header;
45
use crate::table::boot::BootServices;
56
use crate::table::configuration::ConfigurationTable;
67
use crate::table::runtime::RuntimeServices;
7-
use crate::table::Header;
88
use crate::{Char16, Handle};
99
use core::mem::size_of;
1010
use core::ptr;

0 commit comments

Comments
 (0)