NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #2093 most downloaded on crates.io
Provides macros for duplication of code with variable substitution.
Last release 11 months ago
03 Nov 2025
Release timing varies
gaps range from 3 weeks to 1.5 years
Most releases are documented
notes for 18 of 23 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
24 releases · first in 2020
One column per quarter.
Module disambiguation now errors if cannot disambiguate.
Module disambiguation now errors if cannot disambiguate.
duplicate are expanded before outer calls.proc-macro2-diagnostics crate.[CI] Removed beta channel from testing temporarily
[CI] Removed beta channel from testing temporarily
substitute! and substitute_item allow the use of global substitutions without duplication. See #49.duplicate! and duplicate_item no longer allow using exclusively global substitutions.proc-macro-error dependency with proc-macro2-diagnostics for printing nice error messages and hints. See #61.heck dependency to version 0.5.Additional error reporting improvements.
Additional error reporting improvements.
pretty_errors feature to more consistently provide useful hints and code highlights. See #19.duplicate now also substitutes the invocations of nested duplicate's. See #48.proc_macro::Span tracks the edition of the code. Previously, duplicate's edition was inserted into the expanded code by not setting the span of create
proc_macro::Span tracks the edition of the code.
Previously, duplicate's edition was inserted into the expanded
code by not setting the span of created proc_macro::Groups.
Added one specific test (in tests/no_features/edition_2021)
that exhibits the problem, however, it is difficult to know
if there are other cases.
The test ensure_no_group_new was added to try and catch
any wrong creation of groups in the future.
duplicate's edition would leak into the user's code. See #47.Also added correct name to copyright files.
Also added correct name to copyright files.
duplicate::duplicate to duplicate::duplicate_item. See #40.duplicate::duplicate_inline to duplicate::duplicate. See #40.duplicate!{[<invocation>] <body>} syntax instead of #[<invocation>][<body>]. See #28.heck dependency to version 0.4.Removed Travis CI configuration.
Removed Travis CI configuration.
convert_case dependency for heck. See #22.Updated the changelog and documentation to reflect this.
Updated the changelog and documentation to reflect this.
This ensures that the duplicate_inline invocation is not regarded as a statement (in the previously automatically added main) which is unsupported for
This ensures that the duplicate_inline invocation is not
regarded as a statement (in the previously automatically
added main) which is unsupported for rust <1.45.
CI: Updated crates.io API key used by Travis.
CI: Updated crates.io API key used by Travis.
duplicate_inline: Function-like procedural macro version of duplicate.
Has the same functionality, but can be used in other contexts and can duplicate any number of items.
See also #6.proc_macro_error dependency to version 1.0.4.Renamed 'auto_mods' feature to 'module_disambiguation'
Renamed 'auto_mods' feature to 'module_disambiguation'
pretty_errors (enabled by default). When enabled, errors are more detailed and helpful.module_disambiguation (enabled by default). When enabled, automatically uses a suitable substitution identifier to disambiguate the name of a module being duplicated. See the documentation for more details. See also #7.pretty_errors feature is enabled.proc_macro_error crate is now optional and used by the pretty_errors feature.The proc_macro_error dependency is fixed to version 1.0.3 to avoid potential breaking changes with future updates to that crate.
proc_macro_error. See #11.proc_macro_error dependency is fixed to version 1.0.3 to avoid potential breaking changes with future updates to that crate.Fixed issue with the short syntax where substitutions that included any bracket type would be expanded wrong. See #9.
Short syntax now supports parameterized substitution. This allows identifiers to take arguments that can be used to customize the substitution for eac
Short syntax now supports nested macro invocations. Can only be used after the initial list of substitution identifiers. See #2.
#[duplicate(..)] would throw an error if it was generated by a macro expansion.
It would fail if a substitution identifier originated from a macro variable.
This is caused by the variable's expansion sometimes being wrapped in a
group with
no delimiters,
which duplicate couldn't handle.Updated crate readme to new short syntax.
Crate readme changelog section now asserts the use of Semantic Versioning and Keep a Changelog.
Crate readme format titles are now bigger than changelog entries.
Crate readme now includes list of changes when published to crates.io.
crates.io.Nothing published for this version
duplicate attribute macro for code duplication and substitution.
duplicate attribute macro for code duplication and substitution.duplicate.duplicate.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →