Repository: dtolnay/cxx (language: rust)

Issue:
bazel: force vendored proc-macro2 to edition=2018
```
Proc-macro2 uses macro syntax which changed meaning in the 2021 edition
of rust[1] and thus throws a compile error unless/until you change the
symbol to one not introduced in proc-macro2's current MSRV.

cxx.rs currently sets edition=2018 at its top level, but other
repositories importing it may set edition=2021, which will apply to
vendored repositories unless overwritten at the target level
(apparently).

As proc-macro2 does not compile under edition=2021, force it to use
edition=2018.

[1] https://doc.rust-lang.org/edition-guide/rust-2021/or-patterns-macro-rules.html
```

Fixes #1031.

I'm assuming this is preferable to fixing proc-macro2 itself, which from my testing would require an MSRV bump to much newer rust for `pat_param`.

This change is sufficient to get my build working again even with a default top-level `edition="2021"`.


Discussion / hints:

Fix patch:
diff --git a/WORKSPACE b/WORKSPACE
index 7df136dac..276fce205 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -4,11 +4,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
 http_archive(
     name = "rules_rust",
-    sha256 = "3cf493f845837b9c0c44311992a8e387b508a267cb8f261ef97b94c915f292cc",
-    strip_prefix = "rules_rust-55790492aca01b389d208cd1335b9d8c05e28329",
+    sha256 = "29954bced3e0d1a57ff8db816f5cd8a5856179fc657455729f1eb53b39611419",
+    strip_prefix = "rules_rust-6e1cbbfcd0d140baacc8ff1080f885d2a45296a9",
     urls = [
-        # Main branch as of 2022-04-10
-        "https://github.com/bazelbuild/rules_rust/archive/55790492aca01b389d208cd1335b9d8c05e28329.tar.gz",
+        # PR https://github.com/bazelbuild/rules_rust/pull/1254
+        # on top of the main branch as of 2022-04-10
+        "https://github.com/bazelbuild/rules_rust/archive/6e1cbbfcd0d140baacc8ff1080f885d2a45296a9.tar.gz",
     ],
 )
 
@@ -16,7 +17,10 @@ load("@rules_rust//rust:repositories.bzl", "rust_repositories")
 
 RUST_VERSION = "1.60.0"
 
-rust_repositories(version = RUST_VERSION)
+rust_repositories(
+    edition = "required",
+    version = RUST_VERSION,
+)
 
 load("//tools/bazel:vendor.bzl", "vendor")
 


Test patch: