http icon indicating copy to clipboard operation
http copied to clipboard

The trait `std::convert::From<http::uri::InvalidUri>` is not implemented for `X` when it actually is [version 0.2]

Open gliderkite opened this issue 6 years ago • 0 comments

I have a crate with the following http dependencies (from cargo tree | grep http), after the update from http 0.1 to 0.2:

├── http v0.2.0
│   │   ├── http v0.1.21
│   ├── http v0.1.21 (*)
│   ├── http-body v0.1.0
│   │   ├── http v0.1.21 (*)
│   ├── httparse v1.3.4
│   │   ├── http v0.1.21 (*)
│   ├── http v0.1.21 (*)
│   │   ├── actix-http v0.2.11
│   │   │   │   ├── http v0.1.21 (*)
│   │   │   ├── http v0.1.21 (*)
│   │   │   ├── httparse v1.3.4 (*)
│   │   ├── actix-http v0.2.11 (*)
│   │   │   ├── http v0.1.21 (*)
│   │   │   └── http v0.1.21 (*)
│   │   │   ├── actix-http v0.2.11 (*)
│   │   │   ├── actix-http v0.2.11 (*)

When I compile my project I get the following error (one of many of the same type):

   |
48 |             return Either::A(future::err(e.into()));
   |                                            ^^^^ the trait `std::convert::From<http::uri::InvalidUri>` is not implemented for `error::Error`
   |
   = help: the following implementations were found:
             <error::Error as std::convert::From<&std::io::Error>>
             <error::Error as std::convert::From<failure::error::Error>>
             <error::Error as std::convert::From<http::error::Error>>
             <error::Error as std::convert::From<http::uri::InvalidUri>>
           and 11 others
   = note: required because of the requirements on the impl of `std::convert::Into<error::Error>` for `http::uri::InvalidUri`

(where error::Error is my error type) even though I clearly have the following implementation:

impl From<http::uri::InvalidUri> for error::Error {
    fn from(e: http::uri::InvalidUri) -> Self {
        Error::invalid_arg_msg(Entity::Uri, e)
    }
}

Is this due to the fact that some of my dependencies depend themselves on a previous version of http 0.1? Is there a way to solve this?

gliderkite avatar Dec 11 '19 11:12 gliderkite