Skip to content

http crate does not compile against latest nightly (caused by TryFrom). #49436

Closed

Description

@carllerche

See here: hyperium/http#192

try_from is already defined on on an HttpTryFrom trait in the library.

This is caused by TryFrom being included in prelude.

Activity

  1. carllerche commented on Mar 28, 2018

    @carllerche
    ContributorAuthor

    I replied to @sfackler in the issue linked above, but I thought it would be worth posting here:

    My understanding was that these sorts of "expected breakage" would go through an ecosystem "crater" (or whatever it is called) and if it broke things it wouldn't be applied.

    I understand the problem that one must be able to add new fns / traits, but if breaking the http crate is considered "expected breakage", that seems to fail at Rust's promise for backwards compatibility as this will cascade down do everyone that depends on http as well as production Rust users.

    The "fix" seems to be to not include TryFrom in std's prelude until the next Rust edition, which is coming soon.

  2. seanmonstar commented on Mar 28, 2018

    @seanmonstar
    Contributor

    The "fix" seems to be to not include TryFrom in std's prelude until the next Rust edition, which is coming soon.

    It does seem like adding new traits to the prelude with a generic name like that should be reserved for new editions.


    I'd suggest that the real solution is to have the compiler resolve the conflict by ranking explicit trait imports as higher than traits in a prelude (I guess any glob import).

  3. udoprog commented on Mar 29, 2018

    @udoprog
    Contributor

    There's a fair bit of discussion going on on this topic in the stabilization PR.

  4. Mark-Simulacrum commented on May 29, 2018

    @Mark-Simulacrum
    Member

    Since we've reverted TryFrom stabilization entirely and I believe this is no longer a problem, I'm going to close this.

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

    T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions