gorules / zen

Open-source Business Rules Engine for your Rust, NodeJS, Python or Go applications.
https://gorules.io
MIT License
770 stars 74 forks source link

v0.20.1 fails to compile #142

Closed scottwthompson closed 5 months ago

scottwthompson commented 5 months ago
Default host: x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.77.1 (7cf61ebde 2024-03-27)
   Compiling zen-engine v0.20.1
error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
  --> /.cargo/registry/src/index.crates.io-6f17d22bba15001f/zen-engine-0.20.1/src/handler/custom_node_adapter.rs:13:10
   |
13 |     ) -> impl std::future::Future<Output = NodeResult> + Send;
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

error[E0706]: functions in traits cannot be declared `async`
  --> /.cargo/registry/src/index.crates.io-6f17d22bba15001f/zen-engine-0.20.1/src/handler/custom_node_adapter.rs:20:5
   |
20 |     async fn handle(&self, _: CustomNodeRequest<'_>) -> NodeResult {
   |     -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |     |
   |     `async` because of this
   |
   = note: `async` trait functions are not currently supported
   = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information

Some errors have detailed explanations: E0562, E0706.
For more information about an error, try `rustc --explain E0562`.
error: could not compile `zen-engine` (lib) due to 2 previous errors
zen-testv0.1.0
├── async-trait v0.1.79 (proc-macro)
│   ├── proc-macro2 v1.0.79
│   │   └── unicode-ident v1.0.12
│   ├── quote v1.0.35
│   │   └── proc-macro2 v1.0.79 (*)
│   └── syn v2.0.58
│       ├── proc-macro2 v1.0.79 (*)
│       ├── quote v1.0.35 (*)
│       └── unicode-ident v1.0.12
└── zen-engine v0.20.1
    ├── anyhow v1.0.81
    ├── async-recursion v1.1.0 (proc-macro)
    │   ├── proc-macro2 v1.0.79 (*)
    │   ├── quote v1.0.35 (*)
    │   └── syn v2.0.58 (*)
    ├── async-trait v0.1.79 (proc-macro) (*)
    ├── fixedbitset v0.4.2
    ├── futures v0.3.30
    │   ├── futures-channel v0.3.30
    │   │   ├── futures-core v0.3.30
    │   │   └── futures-sink v0.3.30
    │   ├── futures-core v0.3.30
    │   ├── futures-executor v0.3.30
    │   │   ├── futures-core v0.3.30
    │   │   ├── futures-task v0.3.30
    │   │   └── futures-util v0.3.30
    │   │       ├── futures-channel v0.3.30 (*)
    │   │       ├── futures-core v0.3.30
    │   │       ├── futures-io v0.3.30
    │   │       ├── futures-macro v0.3.30 (proc-macro)
    │   │       │   ├── proc-macro2 v1.0.79 (*)
    │   │       │   ├── quote v1.0.35 (*)
    │   │       │   └── syn v2.0.58 (*)
    │   │       ├── futures-sink v0.3.30
    │   │       ├── futures-task v0.3.30
    │   │       ├── memchr v2.7.2
    │   │       ├── pin-project-lite v0.2.14
    │   │       ├── pin-utils v0.1.0
    │   │       └── slab v0.4.9
    │   │           [build-dependencies]
    │   │           └── autocfg v1.2.0
    │   ├── futures-io v0.3.30
    │   ├── futures-sink v0.3.30
    │   ├── futures-task v0.3.30
    │   └── futures-util v0.3.30 (*)
    ├── itertools v0.12.1
    │   └── either v1.10.0
    ├── json_dotpath v1.1.0
    │   ├── serde v1.0.197
    │   │   └── serde_derive v1.0.197 (proc-macro)
    │   │       ├── proc-macro2 v1.0.79 (*)
    │   │       ├── quote v1.0.35 (*)
    │   │       └── syn v2.0.58 (*)
    │   ├── serde_derive v1.0.197 (proc-macro) (*)
    │   ├── serde_json v1.0.115
    │   │   ├── itoa v1.0.11
    │   │   ├── ryu v1.0.17
    │   │   └── serde v1.0.197 (*)
    │   └── thiserror v1.0.58
    │       └── thiserror-impl v1.0.58 (proc-macro)
    │           ├── proc-macro2 v1.0.79 (*)
    │           ├── quote v1.0.35 (*)
    │           └── syn v2.0.58 (*)
    ├── once_cell v1.19.0
    ├── petgraph v0.6.4
    │   ├── fixedbitset v0.4.2
    │   └── indexmap v2.2.6
    │       ├── equivalent v1.0.1
    │       └── hashbrown v0.14.3
    ├── rquickjs v0.4.3
    │   ├── rquickjs-core v0.4.3
    │   │   ├── relative-path v1.9.2
    │   │   └── rquickjs-sys v0.4.3
    │   │       [build-dependencies]
    │   │       └── cc v1.0.90
    │   └── rquickjs-macro v0.4.3 (proc-macro)
    │       ├── convert_case v0.6.0
    │       │   └── unicode-segmentation v1.11.0
    │       ├── fnv v1.0.7
    │       ├── ident_case v1.0.1
    │       ├── indexmap v2.2.6 (*)
    │       ├── proc-macro-crate v1.3.1
    │       │   ├── once_cell v1.19.0
    │       │   └── toml_edit v0.19.15
    │       │       ├── indexmap v2.2.6 (*)
    │       │       ├── toml_datetime v0.6.5
    │       │       └── winnow v0.5.40
    │       ├── proc-macro-error v1.0.4
    │       │   ├── proc-macro-error-attr v1.0.4 (proc-macro)
    │       │   │   ├── proc-macro2 v1.0.79 (*)
    │       │   │   └── quote v1.0.35 (*)
    │       │   │   [build-dependencies]
    │       │   │   └── version_check v0.9.4
    │       │   ├── proc-macro2 v1.0.79 (*)
    │       │   ├── quote v1.0.35 (*)
    │       │   └── syn v1.0.109
    │       │       ├── proc-macro2 v1.0.79 (*)
    │       │       └── unicode-ident v1.0.12
    │       │   [build-dependencies]
    │       │   └── version_check v0.9.4
    │       ├── proc-macro2 v1.0.79 (*)
    │       ├── quote v1.0.35 (*)
    │       ├── rquickjs-core v0.4.3
    │       │   ├── relative-path v1.9.2
    │       │   └── rquickjs-sys v0.4.3
    │       │       [build-dependencies]
    │       │       └── cc v1.0.90
    │       └── syn v2.0.58 (*)
    ├── serde v1.0.197 (*)
    ├── serde_json v1.0.115 (*)
    ├── thiserror v1.0.58 (*)
    ├── zen-expression v0.20.1
    │   ├── ahash v0.8.11
    │   │   ├── cfg-if v1.0.0
    │   │   ├── getrandom v0.2.13
    │   │   │   ├── cfg-if v1.0.0
    │   │   │   └── libc v0.2.153
    │   │   ├── once_cell v1.19.0
    │   │   └── zerocopy v0.7.32
    │   │   [build-dependencies]
    │   │   └── version_check v0.9.4
    │   ├── bumpalo v3.15.4
    │   ├── chrono v0.4.37
    │   │   ├── iana-time-zone v0.1.60
    │   │   │   └── core-foundation-sys v0.8.6
    │   │   └── num-traits v0.2.18
    │   │       [build-dependencies]
    │   │       └── autocfg v1.2.0
    │   ├── fastrand v2.0.2
    │   ├── hashbrown v0.13.2
    │   │   ├── ahash v0.8.11 (*)
    │   │   └── bumpalo v3.15.4
    │   ├── humantime v2.1.0
    │   ├── nohash-hasher v0.2.0
    │   ├── once_cell v1.19.0
    │   ├── regex v1.10.4
    │   │   ├── aho-corasick v1.1.3
    │   │   │   └── memchr v2.7.2
    │   │   ├── memchr v2.7.2
    │   │   ├── regex-automata v0.4.6
    │   │   │   ├── aho-corasick v1.1.3 (*)
    │   │   │   ├── memchr v2.7.2
    │   │   │   └── regex-syntax v0.8.3
    │   │   └── regex-syntax v0.8.3
    │   ├── rust_decimal v1.35.0
    │   │   ├── arrayvec v0.7.4
    │   │   ├── num-traits v0.2.18 (*)
    │   │   └── serde v1.0.197 (*)
    │   ├── rust_decimal_macros v1.34.2 (proc-macro)
    │   │   ├── quote v1.0.35 (*)
    │   │   └── rust_decimal v1.35.0
    │   │       ├── arrayvec v0.7.4
    │   │       └── num-traits v0.2.18 (*)
    │   ├── serde v1.0.197 (*)
    │   ├── serde_json v1.0.115 (*)
    │   ├── strum v0.25.0
    │   ├── strum_macros v0.25.3 (proc-macro)
    │   │   ├── heck v0.4.1
    │   │   ├── proc-macro2 v1.0.79 (*)
    │   │   ├── quote v1.0.35 (*)
    │   │   ├── rustversion v1.0.15 (proc-macro)
    │   │   └── syn v2.0.58 (*)
    │   └── thiserror v1.0.58 (*)
    └── zen-tmpl v0.20.1
        ├── itertools v0.12.1 (*)
        ├── serde v1.0.197 (*)
        ├── serde_json v1.0.115 (*)
        ├── thiserror v1.0.58 (*)
        └── zen-expression v0.20.1 (*)
stefan-gorules commented 5 months ago

Hi @scottwthompson are you sure you are using 1.77.1? Async fn should be stable within traits now and from the error we see:

error[E0706]: functions in traits cannot be declared async

scottwthompson commented 5 months ago

Ah, had some old rustc artifacts linked with brew that was conflicting.