Skip to content

Commit 44150e3

Browse files
nicholasbishopphip1611
authored andcommitted
uefi: Add "unstable" feature
The unstable feature will be used to gate the use of new unstable features. We hope to make the uefi crate work on the stable channel once the `abi_efiapi` and `default_alloc_error_handler` features are stabilized, so we don't want to start relying unconditionally on new unstable features. For now the new feature just gates `error_in_core`, but some additional features will be gated here soon.
1 parent b35ffb8 commit 44150e3

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

uefi/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ logger = []
1919
# were observed on the VirtualBox UEFI implementation (see uefi-rs#121).
2020
# In those cases, this feature can be excluded by removing the default features.
2121
panic-on-logger-errors = []
22+
unstable = []
2223

2324
[dependencies]
2425
bitflags = "1.3.1"

uefi/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
//! is not a high-performance logger.
3333
//! - `panic-on-logger-errors` (enabled by default): Panic if a text
3434
//! output error occurs in the logger.
35+
//! - `unstable`: Enable functionality that depends on [unstable
36+
//! features] in the nightly compiler. Note that currently the `uefi`
37+
//! crate _always_ requires unstable features even if the `unstable`
38+
//! feature is not enabled, but once a couple more required features
39+
//! are stabilized we intend to make the `uefi` crate work on the
40+
//! stable channel by default.
3541
//!
3642
//! The `global_allocator` and `logger` features require special
3743
//! handling to perform initialization and tear-down. The
@@ -48,13 +54,14 @@
4854
//!
4955
//! [`GlobalAlloc`]: alloc::alloc::GlobalAlloc
5056
//! [`uefi-services`]: https://crates.io/crates/uefi-services
57+
//! [unstable features]: https://doc.rust-lang.org/unstable-book/
5158
5259
#![feature(abi_efiapi)]
5360
#![feature(maybe_uninit_slice)]
5461
#![feature(negative_impls)]
5562
#![feature(ptr_metadata)]
56-
#![feature(error_in_core)]
5763
#![cfg_attr(feature = "alloc", feature(vec_into_raw_parts))]
64+
#![cfg_attr(feature = "unstable", feature(error_in_core))]
5865
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
5966
#![no_std]
6067
// Enable some additional warnings and lints.

uefi/src/result/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ impl<Data: Debug + Display> Display for Error<Data> {
4646
}
4747
}
4848

49+
#[cfg(feature = "unstable")]
4950
impl<Data: Debug + Display> core::error::Error for Error<Data> {}

0 commit comments

Comments
 (0)