From 416e25af0040762aa1258ec1370714944f97894f Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 26 Feb 2024 16:57:55 +0000 Subject: [PATCH] repro? --- src/main.rs | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index ba14590..d77a080 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,20 +1,38 @@ +#![allow(unused_imports)] + use educe::Educe; use std::fmt::{self, Debug}; +trait Object {} +trait ClientSideDb {} + +use std::sync::Arc; +use Arc as DbPtr; +use Arc as ClientDb; + +impl Object for NotDebug {} +impl ClientSideDb for NotDebug {} + #[derive(Educe)] -#[educe(Debug(bound = "X: Debug"))] -pub struct Thing { - #[educe(Debug(method = "no_fmt"))] - field: Box, -} +//#[educe(Clone, Debug(bound(T: Debug)))] +#[educe(Clone(bound()), Debug)] +pub struct Obj { + ptr: DbPtr, + data: Arc, -fn no_fmt(_: &Q, _f: &mut fmt::Formatter) -> fmt::Result { - Ok(()) + #[educe(Debug(ignore))] + db: Arc>, } +#[derive(Clone)] +struct NotDebug; + fn main() { - let a = Thing { - field: Box::new(42), + let a = Obj { + ptr: Arc::new(NotDebug), + data: Arc::new(NotDebug), + db: Arc::new(Arc::new(NotDebug)), }; - println!("{:?}", &a); + let a = a.clone(); +// println!("{:?}", &a); } -- 2.30.2