Closed
Description
It's currently impossible to store DST (Trait object, for example) inside RC:
let x:std::rc::Rc<Reader>;
gives you: the trait 'core::kinds::Sized' must be implemented because it is required by 'alloc::rc::Rc'
. However, you can store trait object inside Box
. Rc
uses Box
internally, so it seems inconsistent that one cannot use refcounted box as replacement for Box
.
One could work around this issue by storing Box<Trait>
inside Rc
, but that would incur double indirection.
Moreover, one couldn't implement their own Rc
because of related ICE: #17959 .
(Maybe related to: #16918 )