Skip to content

Commit

Permalink
Merge pull request #1040 from dtolnay/bazel
Browse files Browse the repository at this point in the history
Pull in my landed edition-related PRs from Bazel rules_rust
  • Loading branch information
dtolnay committed Apr 26, 2022
2 parents f9f215f + e31ca99 commit 267b90d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 4 additions & 6 deletions WORKSPACE
Expand Up @@ -4,12 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "rules_rust",
sha256 = "29954bced3e0d1a57ff8db816f5cd8a5856179fc657455729f1eb53b39611419",
strip_prefix = "rules_rust-6e1cbbfcd0d140baacc8ff1080f885d2a45296a9",
sha256 = "d39af65fc3b88c204e101d4ddc7dd7543be4e2509fa21c35a5d228f54821a2a9",
strip_prefix = "rules_rust-f7cb22efa64a6a07813e30e9f9d70d1fd18e463e",
urls = [
# 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",
# Main branch as of 2022-04-25
"https://github.com/bazelbuild/rules_rust/archive/f7cb22efa64a6a07813e30e9f9d70d1fd18e463e.tar.gz",
],
)

Expand All @@ -18,7 +17,6 @@ load("@rules_rust//rust:repositories.bzl", "rust_repositories")
RUST_VERSION = "1.60.0"

rust_repositories(
edition = "required",
version = RUST_VERSION,
)

Expand Down
12 changes: 6 additions & 6 deletions tools/bazel/third_party.bzl
Expand Up @@ -5,14 +5,14 @@ load("@third-party//:vendor.bzl", "vendored")
def third_party_glob(include):
return vendored and native.glob(include)

def third_party_cargo_build_script(edition, rustc_flags = [], **kwargs):
def third_party_cargo_build_script(rustc_flags = [], **kwargs):
rustc_flags = rustc_flags + ["--cap-lints=allow"]
cargo_build_script(edition = edition, rustc_flags = rustc_flags, **kwargs)
cargo_build_script(rustc_flags = rustc_flags, **kwargs)

def third_party_rust_binary(edition, rustc_flags = [], **kwargs):
def third_party_rust_binary(rustc_flags = [], **kwargs):
rustc_flags = rustc_flags + ["--cap-lints=allow"]
rust_binary(edition = edition, rustc_flags = rustc_flags, **kwargs)
rust_binary(rustc_flags = rustc_flags, **kwargs)

def third_party_rust_library(edition, rustc_flags = [], **kwargs):
def third_party_rust_library(rustc_flags = [], **kwargs):
rustc_flags = rustc_flags + ["--cap-lints=allow"]
rust_library(edition = edition, rustc_flags = rustc_flags, **kwargs)
rust_library(rustc_flags = rustc_flags, **kwargs)

0 comments on commit 267b90d

Please sign in to comment.