[ 
https://issues.apache.org/jira/browse/THRIFT-4536?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16419654#comment-16419654
 ] 

Chao Sun commented on THRIFT-4536:
----------------------------------

{quote}
Would such a change allow compilation on older rustc?
{quote}
Yes if we are targeting stable rustc releases then I guess the only solution to 
make this work with nightly is to fix the `try_from` crate. 

> [Rust] library fails to build with nightly due to try_from error
> ----------------------------------------------------------------
>
>                 Key: THRIFT-4536
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4536
>             Project: Thrift
>          Issue Type: Bug
>          Components: Rust - Library
>            Reporter: Chao Sun
>            Priority: Major
>
> When trying to build the library with rustc nightly, I got the following 
> error:
> {code}
>     Updating registry `https://github.com/rust-lang/crates.io-index`
>    Compiling libc v0.2.40
>    Compiling cfg-if v0.1.2
>    Compiling integer-encoding v1.0.5
>    Compiling byteorder v1.2.1
>    Compiling try_from v0.2.2
>    Compiling log v0.4.1
> error[E0034]: multiple applicable items in scope
>   --> 
> /Users/chao/.cargo/registry/src/github.com-1ecc6299db9ec823/try_from-0.2.2/src/char.rs:46:23
>    |
> 46 |                 match u32::try_from(n)? {
>    |                       ^^^^^^^^^^^^^ multiple `try_from` found
> ...
> 58 | impl_int_to_char!(i8, i16, i32, i64, isize, u16, u32, u64, usize);
>    | ------------------------------------------------------------------ in 
> this macro invocation
>    |
> note: candidate #1 is defined in the trait `TryFrom`
>   --> 
> /Users/chao/.cargo/registry/src/github.com-1ecc6299db9ec823/try_from-0.2.2/src/lib.rs:11:5
>    |
> 11 |     fn try_from(T) -> Result<Self, Self::Err>;
>    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    = help: to disambiguate the method call, write `TryFrom::try_from(...)` 
> instead
> note: candidate #2 is defined in the trait `std::convert::TryFrom`
>    = help: to disambiguate the method call, write 
> `std::convert::TryFrom::try_from(...)` instead
> error: aborting due to previous error
> For more information about this error, try `rustc --explain E0034`.
> error: Could not compile `try_from`.
> warning: build failed, waiting for other jobs to finish...
> error: build failed
> {code}
> cc [~allengeorge]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to