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

Foo<T> can implement CoerceUnsized<Foo<U>> when T implements CoerceUnsized<U> rather than CoerceUnsized<Foo<U>> #1574

Open
xmh0511 opened this issue Aug 15, 2024 · 0 comments

Comments

@xmh0511
Copy link

xmh0511 commented Aug 15, 2024

https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions

Additionally, a type Foo<T> can implement CoerceUnsized<Foo<U>> when T implements Unsize<U> or CoerceUnsized<Foo<U>>. This allows it to provide a unsized coercion to Foo<U>.

However, the document of CoerceUnsized regarding the corresponding case says:

you can directly implement CoerceUnsized<Wrap<U>> for Wrap<T> where T: CoerceUnsized<U>

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

1 participant