-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)
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 )
Metadata
Metadata
Assignees
Labels
A-DSTsArea: Dynamically-sized types (DSTs)Area: Dynamically-sized types (DSTs)