Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4536

[Rust] library fails to build with nightly due to try_from error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • None
    • Rust - Library
    • None

    Description

      When trying to build the library with rustc nightly, I got the following error:

          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
      

      cc allengeorge

      Attachments

        Activity

          People

            Unassigned Unassigned
            csun Chao Sun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: