Skip to content

Commit

Permalink
fix: no_std
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmah309 committed Sep 11, 2024
1 parent 2fcd29d commit 49d77a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ tracing-test = { version = "0.2", features = ["no-env-filter"] }
lazy_static = "1"

[workspace]
members = ["impl"]
members = ["impl", "tests/no_std"]

[features]
default = []
default = ["std"]
std = []
# Each error set will generates a `coerce!` macro to help handle coercion between partially intersecting sets.
coerce_macro = ["error_set_impl/coerce_macro"]
Expand All @@ -39,4 +39,4 @@ record_stub = ["std"]
[package.metadata.docs.rs]
all-features = false
features = ["tracing"]
rustdoc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
10 changes: 5 additions & 5 deletions impl/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ fn impl_error(error_enum_node: &ErrorEnumGraphNode, token_stream: &mut TokenStre
if has_source_match_branches {
token_stream.append_all(quote::quote! {
#[allow(unused_qualifications)]
impl std::error::Error for #enum_name {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
impl core::error::Error for #enum_name {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
match *self {
#source_match_branches
#[allow(unreachable_patterns)]
Expand All @@ -142,7 +142,7 @@ fn impl_error(error_enum_node: &ErrorEnumGraphNode, token_stream: &mut TokenStre
} else {
token_stream.append_all(quote::quote! {
#[allow(unused_qualifications)]
impl std::error::Error for #enum_name {}
impl core::error::Error for #enum_name {}
});
}
}
Expand Down Expand Up @@ -333,8 +333,8 @@ pub(crate) struct ErrorEnum {
pub(crate) error_variants: Vec<AstErrorEnumVariant>,
}

impl std::hash::Hash for ErrorEnum {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
impl core::hash::Hash for ErrorEnum {
fn hash<H: core::hash::Hasher>(&self, state: &mut H) {
self.error_name.hash(state);
}
}
Expand Down

0 comments on commit 49d77a2

Please sign in to comment.