sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Rust decimal not implement std::error:Error

Open neo-clon opened this issue 6 years ago • 1 comments

Hi guys!

I have an issue when try build my project with rust_decimal

error[E0277]: the trait bound `rust_decimal::Error: std::error::Error` is not satisfied
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.4.0-beta.1/src/postgres/types/decimal.rs:171:73
    |
171 |             PgValueFormat::Text => Ok(value.as_str()?.parse::<Decimal>()?),
    |                                                                         ^ the trait `std::error::Error` is not implemented for `rust_decimal::Error`
    |
    = note: required because of the requirements on the impl of `std::convert::From<rust_decimal::Error>` for `std::boxed::Box<dyn std::error::Error + std::marker::Send + std::marker::Sync>`
    = note: required by `std::convert::From::from`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `sqlx-core`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

I try to force the rust_decimal version to 1.7.0 but it doesn't work, keep using 1.8.0

rust_decimal 1.8.0 image rust_decimal 1.7.0 image

neo-clon avatar Sep 15 '20 01:09 neo-clon

I found the solution

Is needed add feature std on rust_decimal

neo-clon avatar Sep 15 '20 01:09 neo-clon