Kimundi / owning-ref-rs

A library for creating references that carry their owner with them.
MIT License
359 stars 50 forks source link

OwningHandle fails with `Rc<RefCell<dyn Trait>>` #69

Open OvermindDL1 opened 3 years ago

OvermindDL1 commented 3 years ago

When attempting to new/new_mut an OwningHandle on a Rc<RefCell<dyn Trait>> type the compiler gives an error of doesn't have a size known at compile-time with the message of:

the trait `std::marker::Sized` is not implemented for `(dyn TheTrait + 'static)`
sollyucko commented 3 years ago

AFAICT, the fix would be to add ?Sized bounds to the ToHandle(Mut) impls, assuming doing so is valid and sound.