Skip to content

Commit 245db44

Browse files
committed
Fill in all the edition attrs to make 'bazel build ...' succeed
1 parent 965044a commit 245db44

File tree

45 files changed

+144
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+144
-6
lines changed

cargo/bootstrap/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ rust_binary(
1414
srcs = [
1515
"bootstrap_installer.rs",
1616
],
17+
edition = "2018",
1718
rustc_env = {
1819
"RULES_RUST_CARGO_BOOTSTRAP_BINARY": "$(rootpath bootstrap_installer.rs)",
1920
},

crate_universe/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ rust_library(
6666
include = ["src/**"],
6767
exclude = ["src/**/*.rs"],
6868
),
69+
edition = "2018",
6970
proc_macro_deps = all_crate_deps(proc_macro = True),
7071
version = VERSION,
7172
visibility = ["//visibility:public"],
@@ -75,6 +76,7 @@ rust_library(
7576
rust_binary(
7677
name = "cargo_bazel_bin",
7778
srcs = ["src/main.rs"],
79+
edition = "2018",
7880
version = VERSION,
7981
visibility = ["//visibility:public"],
8082
deps = [":cargo_bazel"],

crate_universe/tools/cross_installer/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ rust_binary(
1616
":cross",
1717
"@rules_rust//rust/toolchain:current_exec_cargo_files",
1818
],
19+
edition = "2018",
1920
proc_macro_deps = all_crate_deps(proc_macro = True),
2021
rustc_env = {
2122
"CARGO": "$(rootpath @rules_rust//rust/toolchain:current_exec_cargo_files)",

crate_universe/tools/urls_generator/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ rust_binary(
2222
compile_data = [
2323
"//crate_universe/private:urls.bzl",
2424
],
25+
edition = "2018",
2526
proc_macro_deps = all_crate_deps(proc_macro = True),
2627
rustc_env = {
2728
"MODULE_ROOT_PATH": "$(rootpath //crate_universe/private:urls.bzl)",

examples/WORKSPACE.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi
1212

1313
rules_rust_dependencies()
1414

15-
rust_register_toolchains(include_rustc_srcs = True)
15+
rust_register_toolchains(
16+
edition = "2018",
17+
include_rustc_srcs = True,
18+
)
1619

1720
load("@rules_rust//bindgen:repositories.bzl", "rust_bindgen_repositories")
1821

examples/cargo_manifest_dir/external_crate/WORKSPACE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ local_repository(
77

88
load("@rules_rust//rust:repositories.bzl", "rust_repositories")
99

10-
rust_repositories()
10+
rust_repositories(edition = "2018")

examples/crate_universe/WORKSPACE.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_regi
99

1010
rules_rust_dependencies()
1111

12-
rust_register_toolchains(include_rustc_srcs = True)
12+
rust_register_toolchains(
13+
edition = "2018",
14+
include_rustc_srcs = True,
15+
)
1316

1417
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
1518

proto/BUILD.bazel

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ toolchain_type(name = "toolchain")
3434
rust_binary(
3535
name = "optional_output_wrapper",
3636
srcs = ["optional_output_wrapper.rs"],
37+
edition = "2018",
3738
visibility = ["//visibility:public"],
3839
)
3940

@@ -43,7 +44,10 @@ toolchain(
4344
toolchain_type = "@rules_rust//proto:toolchain",
4445
)
4546

46-
rust_proto_toolchain(name = "default-proto-toolchain-impl")
47+
rust_proto_toolchain(
48+
name = "default-proto-toolchain-impl",
49+
edition = "2018",
50+
)
4751

4852
bzl_library(
4953
name = "bzl_lib",

test/build_env/BUILD.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ rust_test(
1010
name = "conflicting_deps_test",
1111
srcs = ["tests/manifest_dir.rs"],
1212
data = ["src/manifest_dir_file.txt"],
13+
edition = "2018",
1314
)
1415

1516
rust_test(
1617
name = "arbitrary_env_test",
1718
srcs = ["tests/arbitrary_env.rs"],
19+
edition = "2018",
1820
rustc_env = {
1921
"USER_DEFINED_KEY": "USER_DEFINED_VALUE",
2022
},
@@ -24,17 +26,20 @@ rust_test(
2426
# Intentionally uses a mix of -s and _s because those normalisations are part of what is being tested.
2527
name = "cargo_env-vars_test",
2628
srcs = ["tests/cargo.rs"],
29+
edition = "2018",
2730
deps = [":cargo_build_script_env-vars_build_script"],
2831
)
2932

3033
rust_test(
3134
name = "cargo-env-vars-custom-crate-name-test",
3235
srcs = ["tests/custom_crate_name.rs"],
3336
crate_name = "custom_crate_name",
37+
edition = "2018",
3438
deps = [":cargo_build_script_env-vars_build_script"],
3539
)
3640

3741
cargo_build_script(
3842
name = "cargo_build_script_env-vars_build_script",
3943
srcs = ["src/build.rs"],
44+
edition = "2018",
4045
)

test/cargo_build_script/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cargo_build_script(
88
name = "tools_exec_build_rs",
99
srcs = ["build.rs"],
1010
build_script_env = {"TOOL": "$(execpath :tool)"},
11+
edition = "2018",
1112
# Add a flag to test that they're exposed to the build script
1213
rustc_flags = ["--verbose"],
1314
tools = [":tool"],
@@ -23,5 +24,6 @@ genrule(
2324
rust_test(
2425
name = "tools_exec",
2526
srcs = ["tools_exec.rs"],
27+
edition = "2018",
2628
deps = [":tools_exec_build_rs"],
2729
)

0 commit comments

Comments
 (0)