Closed kyren closed 1 week ago
We could add a SizedRootable
trait as an "alias" for requiring that the associated Root
type be sized, if we considered it obnoxious to require for<'a> <R as Rootable<'a>>::Root: Sized
everywhere, but realistically I don't think that many people are going to be writing Rootable
bounds?
In https://github.com/kyren/deimos, this ended up being a bit more work than I thought due to the magic downcasting stuff there.
You would think it would just be adding : Sized
bounds everywhere but for some reason I can't fully grasp, it made the compiler creak and groan a bit. I ended up having to drop a Sized
bound on a Collect
impl to make it work, and the error messages until I did that were extremely confusing and entirely about the 'gc
lifetime and I'm not sure why. I don't fully understand why it wasn't exactly the same, but it's possible I just missed a different Sized
bound somewhere or messed something else up.
Adding an alias trait might actually be a good idea if we merge this.
This is significantly less important now that #54 is merged, and in fact I don't know of a use case for it now?
You would think it would just be adding : Sized bounds everywhere but for some reason I can't fully grasp, it made the compiler creak and groan a bit. I ended up having to drop a Sized bound on a Collect impl to make it work, and the error messages until I did that were extremely confusing and entirely about the 'gc lifetime and I'm not sure why. I don't fully understand why it wasn't exactly the same, but it's possible I just missed a different Sized bound somewhere or messed something else up.
Probably ignore this, I think I may have just typoed a 'gc_
as 'gc
somewhere, it didn't make sense that it happened and it may not have?.
superseded by #102
Allows for dynamic rooting of unsized
Gc
pointers.