The current Trace trait is not object-safe, so it can’t be used with trait objects:
trait Foo: Trace {
fn foo(&self);
}
#[derive(Trace)]
struct AnyFoo(dyn Foo);
Could it be made object-safe by turning the associated constants into functions and moving the V: GcVisitor type parameter of Trace::visit<V> up to Trace<V>::visit?
The current
Tracetrait is not object-safe, so it can’t be used with trait objects:Could it be made object-safe by turning the associated constants into functions and moving the
V: GcVisitortype parameter ofTrace::visit<V>up toTrace<V>::visit?