rust_unpretty_aspect.bzl

rust_unpretty_aspect

load("@rules_rust//rust:rust_unpretty_aspect.bzl", "rust_unpretty_aspect")

rust_unpretty_aspect()

Executes Rust expand on specified targets.

This aspect applies to existing rust_library, rust_test, and rust_binary rules.

As an example, if the following is defined in examples/hello_lib/BUILD.bazel:

load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

rust_library(
    name = "hello_lib",
    srcs = ["src/lib.rs"],
)

rust_test(
    name = "greeting_test",
    srcs = ["tests/greeting.rs"],
    deps = [":hello_lib"],
)

Then the targets can be expanded with the following command:

$ bazel build --aspects=@rules_rust//rust:defs.bzl%rust_unpretty_aspect \
              --output_groups=rust_unpretty_expanded \
              //hello_lib:all

ASPECT ATTRIBUTES

ATTRIBUTES