From 264b7d19360332bd2cf8289a54619c3360a2f8fe Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 6 Jul 2023 15:00:49 -0700 Subject: [PATCH] Avoid calling a nonstandard write! macro that might be in scope --- impl/src/attr.rs | 2 +- src/lib.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/impl/src/attr.rs b/impl/src/attr.rs index 9af7c60..0cb8c6f 100644 --- a/impl/src/attr.rs +++ b/impl/src/attr.rs @@ -197,7 +197,7 @@ impl ToTokens for Display<'_> { let fmt = &self.fmt; let args = &self.args; tokens.extend(quote! { - write!(__formatter, #fmt #args) + thiserror::__private::write!(__formatter, #fmt #args) }); } } diff --git a/src/lib.rs b/src/lib.rs index f78ee7e..0f885d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -252,4 +252,6 @@ pub mod __private { pub use crate::display::{DisplayAsDisplay, PathAsDisplay}; #[cfg(provide_any)] pub use crate::provide::ThiserrorProvide; + + pub use std::write; }