diff --git a/derive_builder_core/src/builder.rs b/derive_builder_core/src/builder.rs index 72824f2..9f292b8 100644 --- a/derive_builder_core/src/builder.rs +++ b/derive_builder_core/src/builder.rs @@ -145,6 +145,7 @@ pub struct Builder<'a> { /// Doc-comment of the builder struct. pub doc_comment: Option, /// Whether or not a libstd is used. + #[allow(dead_code)] pub std: bool, } @@ -294,11 +295,9 @@ impl<'a> ToTokens for Builder<'a> { } )); - if self.std { - tokens.append_all(quote!( - impl std::error::Error for #builder_error_ident {} - )); - } + tokens.append_all(quote!( + impl core::error::Error for #builder_error_ident {} + )); } } }