When dealing with traits with default implementations, this wiki suggests adding Send and/or Sync bounds onto the trait to allow the trait to be object-safe.
This works great if the Send or Sync bounds are just plain idents, but if you bound the trait by their expanded ::core::marker::{Send, Sync} forms, then the code doesn't remove the bound from the function.
When dealing with traits with default implementations, this wiki suggests adding
Send
and/orSync
bounds onto the trait to allow the trait to be object-safe.This works great if the Send or Sync bounds are just plain idents, but if you bound the trait by their expanded
::core::marker::{Send, Sync}
forms, then the code doesn't remove the bound from the function.See the expanded code in: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=1345c978f5ae50b27a52cb294f1276ba