Skip to content

Commit 4a1d1c2

Browse files
authored
Support rustdoc_flags parameter for rust_doc_test similar to rust_doc (#3543)
Mirrors the implementation in the `rust_doc` rule
1 parent d7ab9ba commit 4a1d1c2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

rust/private/rustdoc_test.bzl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def _rust_doc_test_impl(ctx):
150150
"--test",
151151
]
152152

153+
rustdoc_flags.extend(ctx.attr.rustdoc_flags)
154+
153155
action = rustdoc_compile_action(
154156
ctx = ctx,
155157
toolchain = toolchain,
@@ -216,6 +218,16 @@ rust_doc_test = rule(
216218
cfg = "exec",
217219
providers = [rust_common.crate_info],
218220
),
221+
"rustdoc_flags": attr.string_list(
222+
doc = dedent("""\
223+
List of flags passed to `rustdoc`.
224+
225+
These strings are subject to Make variable expansion for predefined
226+
source/output path variables like `$location`, `$execpath`, and
227+
`$rootpath`. This expansion is useful if you wish to pass a generated
228+
file of arguments to rustc: `@$(location //package:target)`.
229+
"""),
230+
),
219231
"_process_wrapper": attr.label(
220232
doc = "A process wrapper for running rustdoc on all platforms",
221233
cfg = "exec",

0 commit comments

Comments
 (0)