Skip to content
Open
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
3 changes: 1 addition & 2 deletions regex-automata/src/dfa/automaton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2114,8 +2114,7 @@ impl StartError {
}
}

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

impl core::fmt::Display for StartError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
6 changes: 2 additions & 4 deletions regex-automata/src/util/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ impl SmallIndexError {
}
}

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

impl core::fmt::Display for SmallIndexError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down Expand Up @@ -646,8 +645,7 @@ macro_rules! index_type_impls {
}
}

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

impl core::fmt::Display for $err {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
7 changes: 3 additions & 4 deletions regex-automata/src/util/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1337,8 +1337,8 @@ pub struct PatternSetInsertError {
capacity: usize,
}

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

#[cfg(feature = "alloc")]
impl core::fmt::Display for PatternSetInsertError {
Expand Down Expand Up @@ -1889,8 +1889,7 @@ pub enum MatchErrorKind {
},
}

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

impl core::fmt::Display for MatchError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
6 changes: 2 additions & 4 deletions regex-automata/src/util/wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ impl core::fmt::Display for SerializeError {
}
}

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

/// An error that occurs when deserializing an object defined in this crate.
///
Expand Down Expand Up @@ -211,8 +210,7 @@ impl DeserializeError {
}
}

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

impl core::fmt::Display for DeserializeError {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions regex-lite/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ impl Error {
}
}

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

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions regex-syntax/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ pub enum ErrorKind {
UnsupportedLookAround,
}

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

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions regex-syntax/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ impl From<hir::Error> for Error {
}
}

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

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions regex-syntax/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ pub enum ErrorKind {
UnicodeCaseUnavailable,
}

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

impl core::fmt::Display for Error {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
6 changes: 2 additions & 4 deletions regex-syntax/src/unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ pub enum Error {
#[derive(Debug)]
pub struct CaseFoldError(());

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

impl core::fmt::Display for CaseFoldError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand All @@ -51,8 +50,7 @@ impl core::fmt::Display for CaseFoldError {
#[derive(Debug)]
pub struct UnicodeWordError(());

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

impl core::fmt::Display for UnicodeWordError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down
3 changes: 1 addition & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ impl Error {
}
}

#[cfg(feature = "std")]
impl std::error::Error for Error {
impl core::error::Error for Error {
// TODO: Remove this method entirely on the next breaking semver release.
#[allow(deprecated)]
fn description(&self) -> &str {
Expand Down
Loading