macro_rules! write {
($self:expr, $($arg:tt)*) => { ... };
}Expand description
Drop-in replacement for core::write! that block-wraps the call so the
format_args! temporary is dropped before any .await, keeping the
resulting future Send. Sync callers see no behavior difference.
Workaround for a recurring footgun: core::write!($self, "...", x).await
holds a fmt::Arguments<'_> temporary (containing !Send vtable pointers)
across the await point, poisoning the dispatcher’s Send bound. The
block scope ends the temporary’s lifetime before the future is awaited.
Escape hatch: core_write! is the unmodified macro.