derive_more
Rust procedural macro library that adds additional derive macros missing from the standard library. Provides #[derive(Display, From, Into, FromStr, Add, Sub, Mul, Div, Index, IndexMut, Constructor, Error, IsVariant, Unwrap, TryInto)] and many more. Eliminates boilerplate for common trait implementations — especially useful for newtype patterns and domain-specific types.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Compile-time macro library. No runtime security surface. Proc-macro execution is sandboxed by Rust's macro system.
⚡ Reliability
Best When
You have many newtype wrappers or domain types in Rust that need standard trait implementations — derive_more eliminates hundreds of lines of From/Into/Display boilerplate.
Avoid When
You need custom logic in trait implementations — the macros provide fixed templates; complex formatting or conversion logic requires manual impl.
Use Cases
- • Implement Display, From, Into traits for newtype wrappers in Rust domain models without manual boilerplate
- • Derive arithmetic operators (+, -, *, /) for numeric newtype wrappers (UserId, Price, Count) with #[derive(Add, Sub)]
- • Generate constructor methods, variant predicates, and unwrap helpers for enums with derive_more macros
- • Implement std::error::Error for custom error types with #[derive(Error)] alongside thiserror
- • Add Display formatting to Rust enum variants for human-readable logging and debugging output
Not For
- • Custom error types with structured messages — thiserror is more expressive for error type definitions
- • Display formatting requiring complex logic — derive_more's Display is template-based; custom Display impl needed for dynamic formatting
- • Teams using macros conservatively — derive_more adds compile-time dependency and proc-macro expansion overhead
Interface
Authentication
Compile-time macro library. No runtime, no authentication.
Pricing
MIT license.
Agent Metadata
Known Gotchas
- ⚠ derive_more 1.x introduced breaking changes from 0.99 — enable specific features in Cargo.toml (e.g., derive_more = { features = ["display", "from"] }) instead of enabling all features
- ⚠ #[derive(Display)] requires all struct fields to implement Display — structs with non-Display fields require custom fmt attribute to select which fields to format
- ⚠ #[derive(From)] generates From impls for each inner type — in enums with multiple variants of the same type, ambiguity causes compile errors
- ⚠ #[derive(Error)] requires the std or no-std feature matching your target — no-std environments need explicit feature selection
- ⚠ Arithmetic derives (#[derive(Add)]) operate element-wise on struct fields — ensure all fields support the operation
- ⚠ Compile time increases with many proc-macro derives — in large codebases, selectively enable only needed features to minimize build time impact
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for derive_more.
Scores are editorial opinions as of 2026-03-06.