Add constraint values for the Rust release channel. (#510)

diff --git a/rust/platform/channel/BUILD b/rust/platform/channel/BUILD
new file mode 100644
index 0000000..84fc8c7
--- /dev/null
+++ b/rust/platform/channel/BUILD
@@ -0,0 +1,22 @@
+package(default_visibility = ["//visibility:public"])
+
+# Allows toolchains and targets to constrain themselves based on Rust release
+# channels, for example when depending on features only available in Nightly.
+#
+# https://doc.rust-lang.org/book/appendix-07-nightly-rust.html
+constraint_setting(name = "channel")
+
+constraint_value(
+    name = "beta",
+    constraint_setting = ":channel",
+)
+
+constraint_value(
+    name = "nightly",
+    constraint_setting = ":channel",
+)
+
+constraint_value(
+    name = "stable",
+    constraint_setting = ":channel",
+)