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

the trait core::convert::From<usize> is not implemented for the type u64 #30495

Closed
kornelski opened this issue Dec 20, 2015 · 2 comments
Closed

Comments

@kornelski
Copy link
Contributor

There are various From implementations for integers, but this one is curiously absent.

I thought about making a pull request, but I can't find where the other integer From traits are defined.

@petrochenkov
Copy link
Contributor

I can't find where the other integer From traits are defined.

https://github.com/rust-lang/rust/blob/master/src/libcore/num/mod.rs#L1984

The discusion about usize is in #28921 and #29220 (make sure to "Show outdated diff")
TL;DR: We need more motivating examples and maybe some mini-RFC describing the portability aspect to dispel the fears of the libs team.

@kornelski
Copy link
Contributor Author

Thanks @petrochenkov. Both issues are about conversion to usize, which is the opposite direction than specified in this issue. I needed conversion from usize to u64 in order to use a FFI.

Anyway, I've noticed that there is a trait for usize to size_t, so I can tweak my FFI and use that instead.

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