Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document CoerceUnsized and DispatchFromDyn types as special #710

Open
RalfJung opened this issue Nov 4, 2019 · 1 comment
Open

Document CoerceUnsized and DispatchFromDyn types as special #710

RalfJung opened this issue Nov 4, 2019 · 1 comment

Comments

@RalfJung
Copy link
Member

RalfJung commented Nov 4, 2019

The "special types" page lists Rc, Arc and a few others as special because they can be method receivers. This is achieved by them implementing a magic trait, Receiver. Given that, shouldn't we do the same for other magic traits? The ones I can think of right now are CoerceUnsized and DispatchFromDyn.

Relatedly, CoerceUnsized and Unsize are actually mentioned in the docs ("type coercions"), but Receiver and DispatchFromDyn are not.

@ehuss
Copy link
Contributor

ehuss commented Nov 4, 2019

Receiver was intentionally excluded since it isn't stable, so the few types that are allowed on stable were listed explicitly instead. But, yea, that is inconsistent with CoerceUnsized. I would say, if the reference intends to stick to the stable language definition, then it should only explain the visible effects, or make it clear these traits are internal (and list the types where it is exposed). Either way is a little awkward, though.

Also, see #591, the "special types" page isn't exhaustive, and I suspect there are other types that could be added. I also expected Receiver to get stabilized, which would remove some of the awkward description, but that has taken longer than I expected.

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

No branches or pull requests

2 participants