diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index 218817293..1b5f59cd9 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -346,6 +346,8 @@ def _rust_test_impl(ctx): ctx.attr.rustc_env, data_paths, )) + aliases = dict(crate.aliases) + aliases.update(ctx.attr.aliases) # Build the test binary using the dependency's srcs. crate_info_dict = dict( @@ -355,7 +357,7 @@ def _rust_test_impl(ctx): srcs = depset(srcs, transitive = [crate.srcs]), deps = depset(deps, transitive = [crate.deps]), proc_macro_deps = depset(proc_macro_deps, transitive = [crate.proc_macro_deps]), - aliases = ctx.attr.aliases, + aliases = aliases, output = output, rustc_output = generate_output_diagnostics(ctx, output), edition = crate.edition, diff --git a/test/renamed_deps/BUILD.bazel b/test/renamed_deps/BUILD.bazel index e7dc187ff..79c2e710c 100644 --- a/test/renamed_deps/BUILD.bazel +++ b/test/renamed_deps/BUILD.bazel @@ -41,10 +41,6 @@ rust_test( rust_test( name = "mod3_test", - aliases = { - ":mod1": "alias_a", - ":mod2": "alias_b", - }, crate = ":mod3", edition = "2018", )