Squashed 'third_party/rules_rust/' content from commit bf59038ca
git-subtree-dir: third_party/rules_rust
git-subtree-split: bf59038cac11798cbaef9f3bf965bad8182b97fa
Signed-off-by: Brian Silverman <bsilver16384@gmail.com>
Change-Id: I5a20e403203d670df467ea97dde9a4ac40339a8d
diff --git a/BUILD.bazel b/BUILD.bazel
new file mode 100644
index 0000000..598746e
--- /dev/null
+++ b/BUILD.bazel
@@ -0,0 +1,72 @@
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
+load("//rust:defs.bzl", "capture_clippy_output", "error_format", "extra_exec_rustc_flags", "extra_rustc_flags")
+
+exports_files(["LICENSE"])
+
+bzl_library(
+ name = "bzl_lib",
+ srcs = [
+ ":workspace.bzl",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+alias(
+ name = "rules",
+ actual = ":bzl_lib",
+ deprecation = "Please use the `@rules_rust//:bzl_lib` target instead",
+ visibility = ["//visibility:public"],
+)
+
+# This setting may be changed from the command line to generate machine readable errors.
+error_format(
+ name = "error_format",
+ build_setting_default = "human",
+ visibility = ["//visibility:public"],
+)
+
+# This setting may be used to pass extra options to rustc from the command line
+# in non-exec configuration.
+# It applies across all targets whereas the rustc_flags option on targets applies only
+# to that target. This can be useful for passing build-wide options such as LTO.
+extra_rustc_flags(
+ name = "extra_rustc_flags",
+ build_setting_default = [],
+ visibility = ["//visibility:public"],
+)
+
+# This setting may be used to pass extra options to rustc from the command line
+# in exec configuration.
+# It applies across all targets whereas the rustc_flags option on targets applies only
+# to that target. This can be useful for passing build-wide options such as LTO.
+extra_exec_rustc_flags(
+ name = "extra_exec_rustc_flags",
+ build_setting_default = [],
+ visibility = ["//visibility:public"],
+)
+
+# This setting is used by the clippy rules. See https://bazelbuild.github.io/rules_rust/rust_clippy.html
+label_flag(
+ name = "clippy.toml",
+ build_setting_default = "//tools/clippy:clippy.toml",
+ visibility = ["//visibility:public"],
+)
+
+# This setting is used by the rustfmt rules. See https://bazelbuild.github.io/rules_rust/rust_fmt.html
+label_flag(
+ name = "rustfmt.toml",
+ build_setting_default = "//tools/rustfmt:rustfmt.toml",
+ visibility = ["//visibility:public"],
+)
+
+alias(
+ name = "rustfmt",
+ actual = "//tools/rustfmt",
+ visibility = ["//visibility:public"],
+)
+
+capture_clippy_output(
+ name = "capture_clippy_output",
+ build_setting_default = False,
+ visibility = ["//visibility:public"],
+)