Update Rust rules to use Rust 1.2.0. Rename features attribute to
crate_features to fix conflict with new default features attribute.

--
MOS_MIGRATED_REVID=101454678
diff --git a/README.md b/README.md
index 369ca5e..c82179d 100644
--- a/README.md
+++ b/README.md
@@ -148,7 +148,7 @@
 <a name="reference-rust_library"></a>
 ### `rust_library`
 
-`rust_library(name, srcs, deps, data, features, rustc_flags)`
+`rust_library(name, srcs, deps, data, crate_features, rustc_flags)`
 
 <table>
   <thead>
@@ -209,7 +209,7 @@
       </td>
     </tr>
     <tr>
-      <td><code>features</code></td>
+      <td><code>crate_features</code></td>
       <td>
         <code>List of strings, optional</code>
         <p>List of features to enable for this crate.</p>
@@ -234,7 +234,7 @@
 <a name="reference-rust_binary"></a>
 ### `rust_binary`
 
-`rust_binary(name, srcs, deps, data, features, rustc_flags)`
+`rust_binary(name, srcs, deps, data, crate_features, rustc_flags)`
 
 <table>
   <thead>
@@ -295,7 +295,7 @@
       </td>
     </tr>
     <tr>
-      <td><code>features</code></td>
+      <td><code>crate_features</code></td>
       <td>
         <code>List of strings, optional</code>
         <p>List of features to enable for this crate.</p>
@@ -320,7 +320,7 @@
 <a name="reference-rust_test"></a>
 ### `rust_test`
 
-`rust_test(name, srcs, deps, data, features, rustc_flags)`
+`rust_test(name, srcs, deps, data, crate_features, rustc_flags)`
 
 <table>
   <thead>
@@ -380,7 +380,7 @@
       </td>
     </tr>
     <tr>
-      <td><code>features</code></td>
+      <td><code>crate_features</code></td>
       <td>
         <code>List of strings, optional</code>
         <p>List of features to enable for this crate.</p>
diff --git a/rust-darwin-x86_64.BUILD b/rust-darwin-x86_64.BUILD
index 2f067e1..1e3b7c9 100644
--- a/rust-darwin-x86_64.BUILD
+++ b/rust-darwin-x86_64.BUILD
@@ -1,4 +1,4 @@
-BASE_DIR = "rust-1.1.0-x86_64-apple-darwin/"
+BASE_DIR = "rust-1.2.0-x86_64-apple-darwin/"
 
 filegroup(
     name = "rustc",
diff --git a/rust-linux-x86_64.BUILD b/rust-linux-x86_64.BUILD
index 2ec7728..2755910 100644
--- a/rust-linux-x86_64.BUILD
+++ b/rust-linux-x86_64.BUILD
@@ -1,4 +1,4 @@
-BASE_DIR = "rust-1.1.0-x86_64-unknown-linux-gnu/"
+BASE_DIR = "rust-1.2.0-x86_64-unknown-linux-gnu/"
 
 filegroup(
     name = "rustc",
diff --git a/rust.WORKSPACE b/rust.WORKSPACE
index 3b307d2..4086ce8 100644
--- a/rust.WORKSPACE
+++ b/rust.WORKSPACE
@@ -1,13 +1,13 @@
 new_http_archive(
     name = "rust-linux-x86_64",
-    url = "https://static.rust-lang.org/dist/rust-1.1.0-x86_64-unknown-linux-gnu.tar.gz",
-    sha256 = "5a8b1c4bb254a698a69cd05734909a3933567be6996422ff53f947fd115372e6",
+    url = "https://static.rust-lang.org/dist/rust-1.2.0-x86_64-unknown-linux-gnu.tar.gz",
+    sha256 = "2311420052e06b3e698ce892924ec40890a8ff0499902e7fc5350733187a1531",
     build_file = "tools/build_rules/rust/rust-linux-x86_64.BUILD",
 )
 
 new_http_archive(
     name = "rust-darwin-x86_64",
-    url = "https://static.rust-lang.org/dist/rust-1.1.0-x86_64-apple-darwin.tar.gz",
-    sha256 = "ac802916da3f9c431377c00b864a517bc356859495b7a8a123ce2c532ee8fa83",
+    url = "https://static.rust-lang.org/dist/rust-1.2.0-x86_64-apple-darwin.tar.gz",
+    sha256 = "0d471e672fac5a450ae5507b335fda2efc0b22ea9fb7f215c6a9c466dafa2661",
     build_file = "tools/build_rules/rust/rust-darwin-x86_64.BUILD",
 )
diff --git a/rust.bzl b/rust.bzl
index 5913f8a..149f415 100644
--- a/rust.bzl
+++ b/rust.bzl
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 RUST_FILETYPE = FileType([".rs"])
-C_LIB_FILETYPE = FileType([".a"])
+A_FILETYPE = FileType([".a"])
 
 def _relative(src_path, dest_path):
   """
@@ -78,7 +78,7 @@
 
     # If this rule depends on a cc_library
     if hasattr(dep, "cc"):
-      native_libs = C_LIB_FILETYPE.filter(dep.cc.libs)
+      native_libs = A_FILETYPE.filter(dep.cc.libs)
       libs += native_libs
       transitive_libs += native_libs
       symlinked_libs += native_libs
@@ -135,7 +135,7 @@
     ar = "/usr/bin/ar"
 
   # Construct features flags
-  features_flags = _get_features_flags(ctx.attr.features)
+  features_flags = _get_features_flags(ctx.attr.crate_features)
 
   return " ".join([
       "set -e;",
@@ -261,7 +261,7 @@
     "srcs": attr.label_list(allow_files = RUST_FILETYPE),
     "data": attr.label_list(allow_files = True, cfg = DATA_CFG),
     "deps": attr.label_list(),
-    "features": attr.string_list(),
+    "crate_features": attr.string_list(),
     "rustc_flags": attr.string_list(),
     "_rustc": attr.label(
         default = Label("//tools/build_rules/rust:rustc"),
diff --git a/test/rust_rule_test.bzl b/test/rust_rule_test.bzl
index e9f957e..799958b 100644
--- a/test/rust_rule_test.bzl
+++ b/test/rust_rule_test.bzl
@@ -1,5 +1,3 @@
-"""Tests for rust rules."""
-#
 # Copyright 2015 Google Inc. All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,46 +12,58 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-load("/third_party/bazel/tools/build_rules/rust/rust",
-     "rust_library", "rust_binary", "rust_test")
-load("/third_party/bazel/tools/build_rules/test_rules",
-     "success_target",
-     "successful_test",
-     "failure_target",
-     "failed_test",
-     "assert_",
-     "strip_prefix",
-     "expectation_description",
-     "check_results",
-     "load_results",
-     "analysis_results",
-     "rule_test",
-     "file_test")
+"""Tests for rust rules."""
 
+load(
+    "/tools/build_rules/rust/rust",
+    "rust_library",
+    "rust_binary",
+    "rust_test",
+)
+
+load(
+    "/tools/build_rules/test_rules",
+    "success_target",
+    "successful_test",
+    "failure_target",
+    "failed_test",
+    "assert_",
+    "strip_prefix",
+    "expectation_description",
+    "check_results",
+    "load_results",
+    "analysis_results",
+    "rule_test",
+    "file_test",
+)
 
 def _rust_library_test(package):
   rule_test(
-      name="hello_lib_rule_test",
-      generates=["libhello_lib.rlib"],
-      provides={
+      name ="hello_lib_rule_test",
+      generates = ["libhello_lib.rlib"],
+      provides = {
           "rust_lib": "/libhello_lib.rlib$",
-          "transitive_libs": "^\\[\\]$"},
-      rule=package + "/hello_lib:hello_lib")
+          "transitive_libs": "^\\[\\]$"
+      },
+      rule = package + "/hello_lib:hello_lib",
+  )
 
 
 def _rust_binary_test(package):
   rule_test(
-      name="hello_world_rule_test",
-      generates=["hello_world"],
-      rule=package + "/hello_world:hello_world")
+      name = "hello_world_rule_test",
+      generates = ["hello_world"],
+      rule = package + "/hello_world:hello_world",
+  )
 
 
 def _rust_test_test(package):
   """Issue rule tests for rust_test."""
   rule_test(
-      name="greeting_rule_test",
-      generates=["greeting"],
-      rule=package + "/hello_lib:greeting")
+      name = "greeting_rule_test",
+      generates = ["greeting"],
+      rule = package + "/hello_lib:greeting",
+  )
 
 
 def rust_rule_test(package):