Skip to content

Remove unstable gate for core::error::Error impls #1497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions uefi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Changed
- MSRV increased to 1.81.
- `core::error::Error` impls are no longer gated by the `unstable` feature.


# uefi - 0.33.0 (2024-10-23)
Expand Down
1 change: 0 additions & 1 deletion uefi/src/data_types/chars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl Display for CharConversionError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for CharConversionError {}

/// A Latin-1 character
Expand Down
1 change: 0 additions & 1 deletion uefi/src/data_types/owned_strs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ impl Display for FromStrError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for FromStrError {}

/// An owned UCS-2 null-terminated string.
Expand Down
4 changes: 0 additions & 4 deletions uefi/src/data_types/strs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl Display for FromSliceUntilNulError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for FromSliceUntilNulError {}

/// Error converting from a slice (which cannot contain interior nuls) to a
Expand All @@ -57,7 +56,6 @@ impl Display for FromSliceWithNulError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for FromSliceWithNulError {}

/// Error returned by [`CStr16::from_unaligned_slice`].
Expand Down Expand Up @@ -88,7 +86,6 @@ impl Display for UnalignedCStr16Error {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for UnalignedCStr16Error {}

/// Error returned by [`CStr16::from_str_with_buf`].
Expand All @@ -115,7 +112,6 @@ impl Display for FromStrWithBufError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for FromStrWithBufError {}

/// A null-terminated Latin-1 string.
Expand Down
8 changes: 3 additions & 5 deletions uefi/src/fs/file_system/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,16 @@ impl From<PathError> for Error {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for Error {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
Error::Io(err) => Some(err),
Error::Path(err) => Some(err),
Error::Utf8Encoding(err) => Some(err),
Self::Io(err) => Some(err),
Self::Path(err) => Some(err),
Self::Utf8Encoding(err) => Some(err),
}
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for IoError {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
Some(&self.uefi_error)
Expand Down
1 change: 0 additions & 1 deletion uefi/src/fs/path/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ impl Display for PathError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for PathError {}

/// Validates a path for the needs of the [`fs`] module.
Expand Down
1 change: 0 additions & 1 deletion uefi/src/mem/memory_map/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ impl Display for MemoryMapError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for MemoryMapError {}

/// Implementation of [`MemoryMap`] for the given buffer.
Expand Down
1 change: 0 additions & 1 deletion uefi/src/proto/boot_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ impl Display for BootPolicyError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for BootPolicyError {}

/// The UEFI boot policy is a property that influences the behaviour of
Expand Down
1 change: 0 additions & 1 deletion uefi/src/proto/device_path/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ impl Display for BuildError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for BuildError {}

/// Trait for types that can be used to build a node via
Expand Down
5 changes: 2 additions & 3 deletions uefi/src/proto/device_path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,11 @@ impl Display for DevicePathToTextError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for DevicePathToTextError {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match self {
DevicePathToTextError::CantLocateHandleBuffer(e) => Some(e),
DevicePathToTextError::CantOpenProtocol(e) => Some(e),
Self::CantLocateHandleBuffer(e) => Some(e),
Self::CantOpenProtocol(e) => Some(e),
_ => None,
}
}
Expand Down
1 change: 0 additions & 1 deletion uefi/src/proto/driver/component_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ impl Display for LanguageError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for LanguageError {}

#[derive(Debug, PartialEq)]
Expand Down
1 change: 0 additions & 1 deletion uefi/src/proto/media/file/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ impl Display for FileInfoCreationError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for FileInfoCreationError {}

/// Generic file information
Expand Down
3 changes: 0 additions & 3 deletions uefi/src/proto/network/pxe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,6 @@ impl Display for IcmpError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for IcmpError {}

/// Corresponds to the anonymous union inside
Expand Down Expand Up @@ -1294,7 +1293,6 @@ impl Display for TftpError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for TftpError {}

/// Returned by [`BaseCode::tftp_read_dir`].
Expand Down Expand Up @@ -1337,5 +1335,4 @@ impl Display for ReadDirParseError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for ReadDirParseError {}
1 change: 0 additions & 1 deletion uefi/src/proto/string/unicode_collation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,4 @@ impl Display for StrConversionError {
}
}

#[cfg(feature = "unstable")]
impl core::error::Error for StrConversionError {}
1 change: 0 additions & 1 deletion uefi/src/result/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,4 @@ impl<Data: Debug> Error<Data> {
}
}

#[cfg(feature = "unstable")]
impl<Data: Debug> core::error::Error for Error<Data> {}
1 change: 0 additions & 1 deletion uefi/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,6 @@ pub struct TimeError {
pub daylight: bool,
}

#[cfg(feature = "unstable")]
impl core::error::Error for TimeError {}

impl Display for TimeError {
Expand Down
Loading