Skip to content

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

Closed

Description

@kornelski

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.

Activity

  1. petrochenkov commented on Dec 20, 2015

    @petrochenkov
    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.

  2. kornelski commented on Dec 20, 2015

    @kornelski
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions