From c70cb7def9064810d7ca2a006a2cc7a2419e11bd Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Sat, 10 Aug 2024 15:14:14 +1000 Subject: [PATCH] remove future-incompatible impl for dyn CloneAny + Send (+Sync) --- src/any.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/any.rs b/src/any.rs index 636cb92..3982b94 100644 --- a/src/any.rs +++ b/src/any.rs @@ -1,7 +1,7 @@ -use core::fmt; -use core::any::{Any, TypeId}; #[cfg(not(feature = "std"))] use alloc::boxed::Box; +use core::any::{Any, TypeId}; +use core::fmt; #[doc(hidden)] pub trait CloneToAny { @@ -44,7 +44,7 @@ macro_rules! impl_clone { f.pad(stringify!($t)) } } - } + }; } /// Methods for downcasting from an `Any`-like trait object. @@ -135,11 +135,9 @@ implement!(Any + Send + Sync); /// /// Every type with no non-`'static` references that implements `Clone` implements `CloneAny`. /// See [`core::any`] for more details on `Any` in general. -pub trait CloneAny: Any + CloneToAny { } -impl CloneAny for T { } +pub trait CloneAny: Any + CloneToAny {} +impl CloneAny for T {} implement!(CloneAny); implement!(CloneAny + Send); implement!(CloneAny + Send + Sync); impl_clone!(dyn CloneAny); -impl_clone!(dyn CloneAny + Send); -impl_clone!(dyn CloneAny + Send + Sync);