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

Refactor unsizing coercion documentation #1731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WaffleLapkin
Copy link
Member

The old one was quite confusing and also incorrect in a few places. Follow-up to #1622.

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Feb 9, 2025
@WaffleLapkin WaffleLapkin force-pushed the unsize_coercion_rewrite branch 3 times, most recently from 6f8650a to 08bec64 Compare February 9, 2025 16:56
@rustbot

This comment has been minimized.

@ehuss
Copy link
Contributor

ehuss commented Mar 13, 2025

@rust-lang/types would you be able to review this?

@nikomatsakis
Copy link
Contributor

To add a bit more color, it'd be good to get a double check that the content is factually accurate before spec team takes it on for editorial review.

Comment on lines +270 to +273
<!-- FIXME: are there more requirements for `CoerceUnsized`? -->

r[coerce.unsize.coerce-unsized-impls]
Types which currently implement `CoerceUnsized<_>` (assuming `T: Unsize<U>`, `'a: 'b`, `A: CoerceUnsized<B>`, `Al: Allocator`):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I would prefer to not duplicate the list of impls from the standard library here. I assume the user can click the link to CoerceUnsized to see which impls it has?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, mh. Yes, users can find them in the std docs (that's where I got the impls from!).

However, if we want the reference to be prescriptive, I think we should include this. While this is library code, it controls how a language feature behaves.

But I don't have a strong opinion here, if you think that this is not useful I can remove the list.

The old one was quite confusing and also incorrect in a few places.
@WaffleLapkin WaffleLapkin force-pushed the unsize_coercion_rewrite branch from 08bec64 to 9271fdd Compare March 13, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: The marked PR is awaiting review from a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants