Skip to content

Commit

Permalink
util: no-std error::Error info
Browse files Browse the repository at this point in the history
  • Loading branch information
brodycj committed Jan 7, 2025
1 parent 7211cb7 commit fa428a5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions futures-util/src/abortable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ impl fmt::Display for Aborted {
}
}

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

impl<T> Abortable<T> {
fn try_poll<I>(
Expand Down
3 changes: 1 addition & 2 deletions futures-util/src/io/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,4 @@ impl<T> fmt::Display for ReuniteError<T> {
}
}

#[cfg(feature = "std")]
impl<T: core::any::Any> std::error::Error for ReuniteError<T> {}
impl<T: core::any::Any> core::error::Error for ReuniteError<T> {}
3 changes: 1 addition & 2 deletions futures-util/src/lock/bilock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ impl<T> fmt::Display for ReuniteError<T> {
}
}

#[cfg(feature = "std")]
impl<T: core::any::Any> std::error::Error for ReuniteError<T> {}
impl<T: core::any::Any> core::error::Error for ReuniteError<T> {}

/// Returned RAII guard from the `poll_lock` method.
///
Expand Down
3 changes: 1 addition & 2 deletions futures-util/src/stream/stream/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ impl<T, Item> fmt::Display for ReuniteError<T, Item> {
}
}

#[cfg(feature = "std")]
impl<T: core::any::Any, Item> std::error::Error for ReuniteError<T, Item> {}
impl<T: core::any::Any, Item> core::error::Error for ReuniteError<T, Item> {}

#[cfg(test)]
mod tests {
Expand Down
3 changes: 1 addition & 2 deletions futures-util/src/stream/try_stream/try_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,4 @@ impl<T, E: fmt::Display> fmt::Display for TryChunksError<T, E> {
}
}

#[cfg(feature = "std")]
impl<T, E: fmt::Debug + fmt::Display> std::error::Error for TryChunksError<T, E> {}
impl<T, E: fmt::Debug + fmt::Display> core::error::Error for TryChunksError<T, E> {}
3 changes: 1 addition & 2 deletions futures-util/src/stream/try_stream/try_ready_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,4 @@ impl<T, E: fmt::Display> fmt::Display for TryReadyChunksError<T, E> {
}
}

#[cfg(feature = "std")]
impl<T, E: fmt::Debug + fmt::Display> std::error::Error for TryReadyChunksError<T, E> {}
impl<T, E: fmt::Debug + fmt::Display> core::error::Error for TryReadyChunksError<T, E> {}

0 comments on commit fa428a5

Please sign in to comment.