brson · GitHub

What version are you using?

v20.0.0-rc1
4639f5a

What did you do?

        #[contracttype]
        #[derive(Clone, Debug, Eq, PartialEq)]
        struct Tuples {
            tuple: (u32, u32),
        }

What did you expect to see?

Compile.

What did you see instead?

   Compiling soroban-sdk v20.0.0-rc2 (/home/azureuser/data/stellar/rs-soroban-sdk/soroban-sdk)
error[E0277]: the trait bound `soroban_env_host::xdr::ScVal: From<&(u32, u32)>` is not satisfied
    --> soroban-sdk/src/arbitrary.rs:1547:9
     |
1547 |         #[contracttype]
     |         ^^^^^^^^^^^^^^^ the trait `From<&(u32, u32)>` is not implemented for `soroban_env_host::xdr::ScVal`
     |
     = help: the following other types implement trait `From<T>`:
               <soroban_env_host::xdr::ScVal as From<bool>>
               <soroban_env_host::xdr::ScVal as From<i32>>
               <soroban_env_host::xdr::ScVal as From<i64>>
               <soroban_env_host::xdr::ScVal as From<i128>>
               <soroban_env_host::xdr::ScVal as From<u32>>
               <soroban_env_host::xdr::ScVal as From<u64>>
               <soroban_env_host::xdr::ScVal as From<u128>>
               <soroban_env_host::xdr::ScVal as From<ScValObject>>
             and 15 others
     = note: required for `&(u32, u32)` to implement `Into<soroban_env_host::xdr::ScVal>`
     = note: required for `soroban_env_host::xdr::ScVal` to implement `TryFrom<&(u32, u32)>`
     = note: required for `&(u32, u32)` to implement `TryInto<soroban_env_host::xdr::ScVal>`
     = note: this error originates in the attribute macro `contracttype` (in Nightly builds, run with -Z macro-backtrace for more info)

This is also true of tuple-structs and enums.

Read the original on github.com ↗