Create an async Rust runtime with EventLoop
This is the API I'm envisioning Rust applications using. It doesn't have
everything wrapped yet, but it's enough to write some tests. It also
doesn't have an API managing the types like the C++ templates yet.
Change-Id: I3389cf18ea99f18c14dc8c4e732156d3cf8c8012
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
diff --git a/tools/build_rules/autocxx.bzl b/tools/build_rules/autocxx.bzl
index 82d6d90..4679a6f 100644
--- a/tools/build_rules/autocxx.bzl
+++ b/tools/build_rules/autocxx.bzl
@@ -87,7 +87,9 @@
out_env_file = ctx.actions.declare_file("%s/rustc_env" % gendir)
ctx.actions.write(
output = out_env_file,
- content = "AUTOCXX_RS_JSON_ARCHIVE=%s" % out_rs_json.path,
+ # The first path is valid for rust_library/rust_binary/rust_test/etc, the second one
+ # is valid for rust_doc_test due to working directory differences.
+ content = "AUTOCXX_RS_JSON_ARCHIVE=%s:%s" % (out_rs_json.path, out_rs_json.short_path),
)
out_h = ctx.actions.declare_file("%s_cxxgen.h" % ctx.label.name.rstrip("__gen"))
diff --git a/tools/lint/rustfmt.sh b/tools/lint/rustfmt.sh
index 42bb654..8539101 100755
--- a/tools/lint/rustfmt.sh
+++ b/tools/lint/rustfmt.sh
@@ -23,5 +23,5 @@
# If we have any Rust files, format them.
if ((${#rust_files[@]} > 0)); then
- exec "${RUSTFMT}" "${rust_files[@]}"
+ exec "${RUSTFMT}" --edition=2021 "${rust_files[@]}"
fi