NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #2736 most downloaded on crates.io
Shared utilities between Diplomat macros and code generation
Latest stable
0.17.0
Last release 1 months ago
20 Oct 2026
Ships fairly regularly
a new release about every 2 months
Rarely documented
notes for 4 of 26 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
26 releases · first in 2021
Drag across the ruler to compare, or tap a release to open it.
This is a reminder from the previous release to join our Zulip chat if you're interested in hearing more frequently about Diplomat development: https:
This is a reminder from the previous release to join our Zulip chat if you're interested in hearing more frequently about Diplomat development: https://diplomat.zulipchat.com.
Diplomat now displays errors with specific file information about what Diplomat was evaluating when the error occured.
This used to be limited to the AST in Diplomat 0.16, but Diplomat 0.17 now utilizes location based errors across all Diplomat crates:
If you encounter an error without file information, please file an issue.
(https://github.com/rust-diplomat/diplomat/issues/111)
ffi_error for Traits and CallbacksSome backends that support callbacks and traits can fail to return a value that Rust expects, and Rust will ungracefully exit when such an error occurs.
Diplomat needs a way to communicate these failures to Rust bindings writers. This is where the new #[diplomat::attr(*, ffi_error)] attribute comes in. Weakly typed languages require all traits to return either -> () or Result<T, E> where E is specially marked with ffi_error (see the book for more)
Nanobind has had these changes retroactively applied, so binding authors will need to ensure that all callbacks through Nanobind have the appropriate attributes applied.
While Kotlin runs into these kinds of issues, support has yet to be added. It will be added in the future.
(https://github.com/rust-diplomat/diplomat/issues/1262)
EnumDef, TraitDef, StructDef, etc.) use IdentBuf from the strck crate to store type names. This is now wrapped around the hir::defs::Ident struct, which also includes additional location information for error reports.
hir::defs::Ident acts roughly as a wrapper for IdentBuf, but please don't hesitate to file an issue if anything breaks.hir::lowering::ErrorContext now has an additional location field for error reporting (note that this is different from diplomat_tool::ErrorContext).
set_item and set_subitem now take a location parameter, to account for this change.hir::lowering::ErrorAndContext is now one new type: LoweringReport. LoweringReport implements std::fmt::Display, for automatic (although it can also be converted to an ast::logging::AstReport for finer printing control)
LoweringReport, instead of the location and the error.ast::logging::AstReport, ContextLocation and write_report are now public; backend authors external to Diplomat may want to use these to write their own errors.ErrorContext's ty and method fields are now both Option<Cow<'tcx, hir::LocIdent>> types, which stores both name and location information for errors.
ErrorStore now takes an Option<ErrorContext> for its internal context.abi_compatible and can be used as such across existing backends which support abi_compatible markings (https://github.com/rust-diplomat/diplomat/pull/1290) (Largely agent-driven)DiplomatGenericWrite<T> with limited support for writing vectors of primitive types. (https://github.com/rust-diplomat/diplomat/pull/1289) (Largely agent-driven)DiplomatWrite16 for UTF16 string writeables (https://github.com/rust-diplomat/diplomat/issues/1299) (Largely agent-driven)is_ok and is_err helpers to DiplomatResult (https://github.com/rust-diplomat/diplomat/pull/1304)
nullptr now use the maybe_null<T> type alias (https://github.com/rust-diplomat/diplomat/issues/1222)
Option<&T> and Option<Box<T>> without aborting. (https://github.com/rust-diplomat/diplomat/pull/1271) (First-time contribution by Max Freedom Pollard)&[T] is now correctly passed as DiplomatSlice<T> for abi_compatible slices (https://github.com/rust-diplomat/diplomat/pull/1291) (Largely agent-driven)Box<[u8]> types (https://github.com/rust-diplomat/diplomat/pull/1250) (Contributed by irvingoujAtDevolution and Copilot)handle could be used as a member or method name that results in uncompilable C# (https://github.com/rust-diplomat/diplomat/pull/1283) (Contributed by irvingoujAtDevolution and an LLM)DiplomatChar being able to take None values (https://github.com/rust-diplomat/diplomat/pull/1269) (First-time contribution by Jorge Polanco with Claude)DiplomatGenericWrite type (https://github.com/rust-diplomat/diplomat/pull/1303) (Largely agent-driven)askama to 0.16.1 (https://github.com/rust-diplomat/diplomat/issues/1276) (Contributed by Robert Bastian)
diplomat-tool dependencies that use syn 2.0 to syn 3.0. See https://github.com/rust-diplomat/diplomat/issues/1275Your coding agent can read these notes before it upgrades. Set up the MCP server →
Per discussion in https://github.com/rust-diplomat/diplomat/issues/1235, we now have a dedicated Zulip chat for contributors, maintainers, and anyone
Per discussion in https://github.com/rust-diplomat/diplomat/issues/1235, we now have a dedicated Zulip chat for contributors, maintainers, and anyone curious about Diplomat: https://diplomat.zulipchat.com. Anyone interested in Diplomat is welcome, and no account is needed to browse the channels[^1].
[^1]: You will have to make an account to chat, however.
The Diplomat runtime is moving towards stabilization, so we're implementing a few changes in how we release the diplomat-runtime crate while we move towards diplomat-runtime 1.0.0.
Our goal is to reduce churn for users using multiple diplomat crates in one build. Because diplomat-runtime exposes no_mangle functions, you can only have one copy at a time linked in to a binary. Once we have diplomat-runtime 1.0.0 we will not have these issues at all, but until then, we are going to limit the number of new 0.x.0 releases of diplomat-runtime we make.
Previously, diplomat 0.x.0 would always be accompanied by diplomat-runtime 0.x.0 to make it easy to match dependencies, since there is no formal dependency between diplomat and diplomat-runtime. Now, when using diplomat 0.x.0, please use the latest 0.y.z version of diplomat-runtime where y ≤ x. Once we release diplomat-runtime 1.0.0, this will be simpler, just use 1.0.
generating_struct_fields has been renamed to generate_definition_includes, since this is now used for structs and traits (https://github.com/rust-diplomat/diplomat/commit/e75e0643cccf5e94bca4a5a5b7345c2489ad2953)Error and Exception to classes/enums which are used as errors and exceptions (https://github.com/rust-diplomat/diplomat/pull/1220) (Contributed by mosuem and Robert Bastian)We've upgraded to `syn` v3 to stay up to date with newer minor releases of syn
syn v3We've upgraded to syn v3 to stay up to date with newer minor releases of syn (https://github.com/rust-diplomat/diplomat/pull/1228)
Diplomat used to have a .NET backend with the old AST representation. This was removed since we transitioned to the HIR representation, and existing users have been on an old fork of the AST-based backend. Thankfully, first-time contributor irvingoujAtDevolution has been hard at work implementing the new HIR-based .NET backend:
https://github.com/rust-diplomat/diplomat/pull/1164 (co-authored with Claude Code), https://github.com/rust-diplomat/diplomat/pull/1180, https://github.com/rust-diplomat/diplomat/pull/1186, https://github.com/rust-diplomat/diplomat/pull/1191, https://github.com/rust-diplomat/diplomat/pull/1189, https://github.com/rust-diplomat/diplomat/pull/1194, https://github.com/rust-diplomat/diplomat/pull/1195, https://github.com/rust-diplomat/diplomat/pull/1193 (co-authored with Claude Sonnet 4.6), https://github.com/rust-diplomat/diplomat/pull/1201, https://github.com/rust-diplomat/diplomat/pull/1216, https://github.com/rust-diplomat/diplomat/pull/1214, https://github.com/rust-diplomat/diplomat/pull/1213, https://github.com/rust-diplomat/diplomat/pull/1215, https://github.com/rust-diplomat/diplomat/pull/1226, https://github.com/rust-diplomat/diplomat/pull/1225, https://github.com/rust-diplomat/diplomat/pull/1230, https://github.com/rust-diplomat/diplomat/pull/1231
Diplomat Core's MSRV is now 1.88, which enables support for procedural macro locations, which are used in new AST error reports. These new reports highlight line/file information instead of panicking with minimal context. There's a pretty printer that uses annotate-snippets (enabled by default in the tool, enabled elsewhere with the feature flag "pretty-print"), and an ugly printer (uses no extra dependencies, enabled by default in the macro).
This was accomplished in two steps: first, we added proc_macro2::Span information to AST. Subsequently, we made five PRs to replace existing panic!, .expect, and assert! calls in the AST parser with these more detailed reports:
https://github.com/rust-diplomat/diplomat/pull/1172, https://github.com/rust-diplomat/diplomat/pull/1177, https://github.com/rust-diplomat/diplomat/pull/1183, https://github.com/rust-diplomat/diplomat/pull/1206, https://github.com/rust-diplomat/diplomat/pull/1208
#[diplomat::include] for including macro definitions from other files (#917)IndexErrorable indexing operationsdiplomat::result (Contributed by Mark Molinaro and Claude Opus 4.6)Update Diplomat to 0.15.0
Update Diplomat to 0.15.0 (#1095)
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.