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/examples/proto/basic/BUILD.bazel b/examples/proto/basic/BUILD.bazel
new file mode 100644
index 0000000..9853a2e
--- /dev/null
+++ b/examples/proto/basic/BUILD.bazel
@@ -0,0 +1,24 @@
+load("@rules_rust//proto:proto.bzl", "rust_proto_library")
+load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
+
+package(default_visibility = ["//proto:__subpackages__"])
+
+rust_proto_library(
+    name = "common_proto_rust",
+    deps = ["//proto:common"],
+)
+
+rust_library(
+    name = "common_lib",
+    srcs = ["lib.rs"],
+    deps = [":common_proto_rust"],
+)
+
+rust_binary(
+    name = "common_bin",
+    srcs = ["main.rs"],
+    deps = [
+        ":common_lib",
+        ":common_proto_rust",
+    ],
+)
diff --git a/examples/proto/basic/lib.rs b/examples/proto/basic/lib.rs
new file mode 100644
index 0000000..2146b3c
--- /dev/null
+++ b/examples/proto/basic/lib.rs
@@ -0,0 +1,5 @@
+extern crate common_proto_rust;
+
+pub fn do_something(_x: &common_proto_rust::Config) -> bool {
+    true
+}
diff --git a/examples/proto/basic/main.rs b/examples/proto/basic/main.rs
new file mode 100644
index 0000000..12ed82f
--- /dev/null
+++ b/examples/proto/basic/main.rs
@@ -0,0 +1,6 @@
+extern crate common_lib;
+extern crate common_proto_rust;
+
+pub fn main() {
+    common_lib::do_something(&common_proto_rust::Config::new());
+}