Skip to content

Commit

Permalink
rust: Fix bindings generation (#707)
Browse files Browse the repository at this point in the history
This fixes two issues with the rust bindings:
- Constant `EMVC_ABI_VERSION` is not exported, caused by an outdated
`bindgen`
- Enums are not properly rustified, due to invalid configuration.

I've run `cargo test` for the whole workspace and `cargo build` for the
`example-rust-vm`.
  • Loading branch information
iamyulong authored Mar 15, 2024
1 parent f89284f commit 954944a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bindings/rust/evmc-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ categories = ["external-ffi-bindings"]
edition = "2018"

[build-dependencies]
bindgen = "0.59"
bindgen = "0.69.4"
2 changes: 1 addition & 1 deletion bindings/rust/evmc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn gen_bindings() {
// do not generate an empty enum for EVMC_ABI_VERSION
.constified_enum("")
// generate Rust enums for each evmc enum
.rustified_enum("*")
.rustified_enum(".*")
// force deriving the Hash trait on basic types (address, bytes32)
.derive_hash(true)
// force deriving the PratialEq trait on basic types (address, bytes32)
Expand Down

0 comments on commit 954944a

Please sign in to comment.