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

From's orphan rules being asymmetric is annoying #19

Open
scottmcm opened this issue Jul 29, 2019 · 1 comment
Open

From's orphan rules being asymmetric is annoying #19

scottmcm opened this issue Jul 29, 2019 · 1 comment

Comments

@scottmcm
Copy link

I can do impl<T> From<T> for NewType<T>, but I can't do impl<T> From<NewType<T>> for T even though I can do impl From<NewType<u32>> for u32.

That leads to unfortunate huge sets of impls like https://docs.rs/simd-trick/0.3.0/simd_trick/struct.Simd.html#impl-From%3CSimd%3C%5Bm64%3B%208%5D%3E%3E

@scottmcm scottmcm changed the title From being asymmetric is annoying From's orphan rules being asymmetric is annoying Jul 29, 2019
@nox
Copy link

nox commented Jul 29, 2019

Couldn't you do impl Into<T> for NewType<T> though? And thus not have all those impls, given end users are supposed to bound on Into not From?

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