I've been wondering if a derive-like procmacro annotation on traits to automatically generate these for Box/Arc/etc is possible. Would make the boilerplate consistent.
-
-
-
These days it is! Have you seen https://docs.rs/auto_impl/0.3.0/auto_impl/ …?
- 1 more reply
New conversation -
-
-
No, proc_macro cannot see types. But I believe it should be possible to know whether the Size bound is necessary (namely when the value is moved out of).
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
TBH I feel it's just poor defaults on Rust side. If it defaulted to arbitrary T (as it intuitively should), then you would add `: Sized` only where necessary for code to compile.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.