Skip to content

Allow Rootable impls to have ?Sized Root types.#53

Closed
kyren wants to merge 1 commit intomasterfrom
unsized_roots
Closed

Allow Rootable impls to have ?Sized Root types.#53
kyren wants to merge 1 commit intomasterfrom
unsized_roots

Conversation

@kyren
Copy link
Copy Markdown
Owner

@kyren kyren commented May 6, 2023

Allows for dynamic rooting of unsized Gc pointers.

Allows for dynamic rooting of unsized `Gc` pointers.
@kyren
Copy link
Copy Markdown
Owner Author

kyren commented May 6, 2023

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?

@kyren
Copy link
Copy Markdown
Owner Author

kyren commented May 6, 2023

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.

@kyren
Copy link
Copy Markdown
Owner Author

kyren commented May 7, 2023

This is significantly less important now that #54 is merged, and in fact I don't know of a use case for it now?

@kyren
Copy link
Copy Markdown
Owner Author

kyren commented May 8, 2023

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?.

@kyren
Copy link
Copy Markdown
Owner Author

kyren commented Jun 27, 2024

superseded by #102

@kyren kyren closed this Jun 27, 2024
@kyren kyren deleted the unsized_roots branch July 8, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant