Skip to content

Commit 9a26235

Browse files
JakobDegenfacebook-github-bot
authored andcommitted
Rename doctest_link_style to doc_link_style
Summary: All the other doctest specific attrs don't start with `doctest` either (`doc_deps`, etc.) Reviewed By: IanChilds, shayne-fletcher Differential Revision: D49004162 fbshipit-source-id: 329d692da2d0ae1933db9298a5bcd1431d44c14e
1 parent 2cb7c36 commit 9a26235

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

prelude/decls/rust_rules.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ rust_library = prelude_rule(
243243
"doc_linker_flags": attrs.list(attrs.arg(), default = []),
244244
"doc_named_deps": attrs.dict(key = attrs.string(), value = rust_target_dep(is_binary = True), sorted = False, default = {}),
245245
"doctests": attrs.option(attrs.bool(), default = None),
246-
"doctest_link_style": attrs.option(attrs.enum(LinkableDepType), default = None, doc = """
246+
"doc_link_style": attrs.option(attrs.enum(LinkableDepType), default = None, doc = """
247247
Like `link_style` on binaries, but applies specifically to doctests.
248248
"""),
249249
"proc_macro": attrs.bool(default = False),

prelude/rust/rust_library.bzl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,12 @@ def rust_library_impl(ctx: AnalysisContext) -> list[Provider]:
218218
# cares about linkage. So if there is a required link style set for the
219219
# doctests, reuse those same dependency artifacts for the other build
220220
# outputs where static vs static_pic does not make a difference.
221-
if ctx.attrs.doctest_link_style:
221+
if ctx.attrs.doc_link_style:
222222
static_link_style = {
223223
"shared": DEFAULT_STATIC_LINK_STYLE,
224224
"static": LinkStyle("static"),
225225
"static_pic": LinkStyle("static_pic"),
226-
}[ctx.attrs.doctest_link_style]
226+
}[ctx.attrs.doc_link_style]
227227
else:
228228
static_link_style = DEFAULT_STATIC_LINK_STYLE
229229

@@ -243,18 +243,18 @@ def rust_library_impl(ctx: AnalysisContext) -> list[Provider]:
243243

244244
rustdoc_test = None
245245
if doctests_enabled and toolchain_info.rustc_target_triple == targets.exec_triple(ctx):
246-
if ctx.attrs.doctest_link_style:
247-
doctest_link_style = LinkStyle(ctx.attrs.doctest_link_style)
246+
if ctx.attrs.doc_link_style:
247+
doc_link_style = LinkStyle(ctx.attrs.doc_link_style)
248248
else:
249-
doctest_link_style = {
249+
doc_link_style = {
250250
"any": LinkStyle("shared"),
251251
"shared": LinkStyle("shared"),
252252
"static": DEFAULT_STATIC_LINK_STYLE,
253253
}[ctx.attrs.preferred_linkage]
254254
rustdoc_test_params = build_params(
255255
rule = RuleType("binary"),
256256
proc_macro = ctx.attrs.proc_macro,
257-
link_style = doctest_link_style,
257+
link_style = doc_link_style,
258258
preferred_linkage = Linkage(ctx.attrs.preferred_linkage),
259259
lang = LinkageLang("rust"),
260260
linker_type = compile_ctx.cxx_toolchain_info.linker_info.type,

0 commit comments

Comments
 (0)