locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
475 stars 128 forks source link

error[E0277]: the trait bound `f64: From<bool>` is not satisfied #316

Closed activatekillswitch closed 3 months ago

activatekillswitch commented 3 months ago

Crate version 0.12.0 as well as on master e3dffb3

error[E0277]: the trait bound `f64: From<bool>` is not satisfied
   --> C:\...\.cargo\git\checkouts\opcua-49af4c4898b3317f\e3dffb3\lib\src\types\variant.rs:868:72
    |
868 |                     VariantTypeId::Double => Variant::Double(f64::from(v)),
    |                                                              --------- ^ the trait `From<bool>` is not implemented for `f64`
    |                                                              |
    |                                                              required by a bound introduced by this call
    |
    = help: the following other types implement trait `From<T>`:
              <f32 as From<i16>>
              <f32 as From<i8>>
              <f32 as From<u16>>
              <f32 as From<u8>>
              <f64 as From<f32>>
              <f64 as From<i16>>
              <f64 as From<i32>>
              <f64 as From<i8>>
            and 73 others

Both the f32 and f64 casts are failing compile

dependencies in Cargo.toml

[dependencies]
rand = "0.9.0-alpha.0"
opcua = { git = "https://github.com/locka99/opcua.git", branch = "master", features = ["console-logging", "server"] }
chrono = "0.4"
einarmo commented 3 months ago

This was stabilized in rust 1.68, you're on a rather old rust version.

activatekillswitch commented 3 months ago

Currently on rustc 1.66.0 (69f9c33d7 2022-12-12)

Now rustc 1.76.0 (07dca489a 2024-02-04)

Building perfectly!