Skip to content

Commit

Permalink
Merge pull request #1497 from nicholasbishop/bishop-error-stable
Browse files Browse the repository at this point in the history
Remove unstable gate for `core::error::Error` impls
  • Loading branch information
phip1611 authored Dec 15, 2024
2 parents 048896a + 06744d5 commit dfbed8e
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 26 deletions.
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

0 comments on commit dfbed8e

Please sign in to comment.