Skip to content

Commit 614373b

Browse files
committed
fix
1 parent bcd25ab commit 614373b

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

module/core/former_meta/src/derive_former/former_enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
#![allow(unused_variables)] // Temporary for placeholder handlers
119119

120120

121-
use macro_tools::{Result, generic_params::GenericsRef, syn, proc_macro2, diag};
121+
use macro_tools::{Result, generic_params::GenericsRef, syn, proc_macro2};
122122
use macro_tools::quote::{format_ident, quote};
123123
use macro_tools::proc_macro2::TokenStream;
124124
use super::struct_attrs::ItemAttributes; // Corrected import

module/core/former_meta/src/derive_former/former_enum/unit_variant_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
//! - **Unit Semantics**: Maintains proper Rust unit variant semantics and syntax
119119
120120
use super::*;
121-
use macro_tools::{Result, quote::quote, syn_err};
121+
use macro_tools::{Result, quote::quote};
122122
use crate::derive_former::raw_identifier_utils::variant_to_method_name;
123123
use crate::derive_former::attribute_validation::{validate_variant_attributes, get_field_count, get_variant_type};
124124

module/core/former_meta/src/derive_former/raw_identifier_utils.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fn is_rust_keyword(s: &str) -> bool {
8282
///
8383
/// This is similar to `ident::ident_maybe_raw` but specifically designed for
8484
/// parameter name generation in constructor contexts.
85+
#[allow(dead_code)]
8586
pub fn field_to_param_name(field_ident: &syn::Ident) -> syn::Ident {
8687
ident::ident_maybe_raw(field_ident)
8788
}
@@ -105,6 +106,7 @@ pub fn strip_raw_prefix_for_compound_ident(ident: &syn::Ident) -> String {
105106
}
106107

107108
/// Creates a constructor name from a struct/enum name, handling raw identifiers.
109+
#[allow(dead_code)]
108110
pub fn type_to_constructor_name(type_ident: &syn::Ident) -> syn::Ident {
109111
let type_str = type_ident.to_string();
110112

@@ -132,7 +134,7 @@ pub fn type_to_constructor_name(type_ident: &syn::Ident) -> syn::Ident {
132134
#[cfg(test)]
133135
mod tests {
134136
use super::*;
135-
use quote::format_ident;
137+
use macro_tools::quote::format_ident;
136138

137139
#[test]
138140
fn test_variant_to_method_name_normal() {

module/core/former_meta/src/derive_former/trait_detection.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use macro_tools::{ syn, quote::quote, proc_macro2 };
2626
/// fn has_former() -> bool { true }
2727
/// }
2828
/// ```
29+
#[allow(dead_code)]
2930
pub fn generate_former_trait_detector() -> proc_macro2::TokenStream {
3031
quote! {
3132
// Compile-time trait detection helper
@@ -46,6 +47,7 @@ pub fn generate_former_trait_detector() -> proc_macro2::TokenStream {
4647
/// Generates code to check if a type implements Former at compile-time.
4748
///
4849
/// Returns a boolean expression that evaluates to true if the type implements Former.
50+
#[allow(dead_code)]
4951
pub fn generate_former_check(field_type: &syn::Type) -> proc_macro2::TokenStream {
5052
quote! {
5153
<() as __FormerDetector<#field_type>>::HAS_FORMER
@@ -58,6 +60,7 @@ pub fn generate_former_check(field_type: &syn::Type) -> proc_macro2::TokenStream
5860
/// This allows handlers to automatically select the best approach:
5961
/// - If type implements Former: Use subform delegation
6062
/// - If type doesn't implement Former: Use scalar/direct approach
63+
#[allow(dead_code)]
6164
pub fn generate_smart_routing(
6265
field_type: &syn::Type,
6366
subform_approach: proc_macro2::TokenStream,
@@ -76,6 +79,7 @@ pub fn generate_smart_routing(
7679

7780
/// Generates a const assertion that can be used to provide better error messages
7881
/// when trait requirements aren't met.
82+
#[allow(dead_code)]
7983
pub fn generate_former_assertion(field_type: &syn::Type, _context: &str) -> proc_macro2::TokenStream {
8084
quote! {
8185
const _: fn() = || {
@@ -89,6 +93,7 @@ pub fn generate_former_assertion(field_type: &syn::Type, _context: &str) -> proc
8993

9094
/// Configuration for smart routing behavior
9195
#[derive(Debug, Clone)]
96+
#[allow(dead_code)]
9297
pub struct SmartRoutingConfig {
9398
/// Whether to prefer subform approach when Former is detected
9499
pub prefer_subform: bool,
@@ -109,6 +114,7 @@ impl Default for SmartRoutingConfig {
109114
}
110115

111116
/// Advanced smart routing with configuration options
117+
#[allow(dead_code)]
112118
pub fn generate_configurable_smart_routing(
113119
field_type: &syn::Type,
114120
subform_approach: proc_macro2::TokenStream,

module/core/test_tools/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@ pub use standalone::*;
133133
#[cfg(not(all(feature = "standalone_build", not(feature = "normal_build"))))]
134134
pub use ::{error_tools, collection_tools, impls_index, mem_tools, typing_tools, diagnostics_tools};
135135

136+
#[cfg(feature = "enabled")]
137+
#[cfg(not(feature = "doctest"))]
138+
#[cfg(not(all(feature = "standalone_build", not(feature = "normal_build"))))]
139+
pub use error_tools::error;
140+
136141
#[cfg(feature = "enabled")]
137142
#[cfg(not(feature = "doctest"))]
138143
#[cfg(all(feature = "standalone_build", not(feature = "normal_build")))]
@@ -164,6 +169,7 @@ pub mod own {
164169

165170
#[doc(inline)]
166171
pub use {
172+
error_tools::{debug_assert_id, debug_assert_identical, debug_assert_ni, debug_assert_not_identical, ErrWith},
167173
collection_tools::orphan::*, impls_index::orphan::*, mem_tools::orphan::*, typing_tools::orphan::*,
168174
diagnostics_tools::orphan::*,
169175
};
@@ -198,6 +204,7 @@ pub mod exposed {
198204

199205
#[doc(inline)]
200206
pub use {
207+
error_tools::{debug_assert_id, debug_assert_identical, debug_assert_ni, debug_assert_not_identical, ErrWith},
201208
collection_tools::exposed::*, impls_index::exposed::*, mem_tools::exposed::*, typing_tools::exposed::*,
202209
diagnostics_tools::exposed::*,
203210
};
@@ -217,6 +224,7 @@ pub mod prelude {
217224

218225
#[doc(inline)]
219226
pub use {
227+
error_tools::{debug_assert_id, debug_assert_identical, debug_assert_ni, debug_assert_not_identical, ErrWith},
220228
collection_tools::prelude::*, impls_index::prelude::*, mem_tools::prelude::*, typing_tools::prelude::*,
221229
diagnostics_tools::prelude::*,
222230
};

0 commit comments

Comments
 (0)