Skip to content

Commit a5b96c7

Browse files
authored
Use toolchain default version during bindgen (#3432)
1 parent 1a19065 commit a5b96c7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extensions/bindgen/private/bindgen.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ def _rust_bindgen_impl(ctx):
221221

222222
# Configure Bindgen Arguments
223223
args.add_all(ctx.attr.bindgen_flags)
224+
225+
rust_toolchain = ctx.toolchains[Label("@rules_rust//rust:toolchain_type")]
226+
if "--rust-edition " not in [f.split("=")[0] for f in ctx.attr.bindgen_flags]:
227+
args.add("--rust-edition=%s" % rust_toolchain.default_edition)
228+
224229
args.add(header)
225230
args.add("--output", output)
226231

0 commit comments

Comments
 (0)