Skip to content

Commit 0bded80

Browse files
matts1googleson78UebelAndre
authored
Add an option to save the json output from rustc to pass to rust-analyzer (#1942)
@googleson78 originally wrote #1657 in order to solve this problem. As discussed in that PR, they're no longer working on this, so I offered to pick this up. This is the same PR as that one, but has some bugfixes and refactoring applied. --------- Co-authored-by: Georgi Lyubenov <[email protected]> Co-authored-by: UebelAndre <[email protected]>
1 parent 742cb46 commit 0bded80

File tree

15 files changed

+224
-50
lines changed

15 files changed

+224
-50
lines changed

BUILD.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ load(
1313
"is_proc_macro_dep_enabled",
1414
"no_std",
1515
"per_crate_rustc_flag",
16+
"rustc_output_diagnostics",
1617
)
1718

1819
exports_files(["LICENSE"])
@@ -32,6 +33,13 @@ error_format(
3233
visibility = ["//visibility:public"],
3334
)
3435

36+
# This setting may be changed from the command line to generate rustc diagnostics.
37+
rustc_output_diagnostics(
38+
name = "rustc_output_diagnostics",
39+
build_setting_default = False,
40+
visibility = ["//visibility:public"],
41+
)
42+
3543
# This setting may be used to pass extra options to clippy from the command line.
3644
# It applies across all targets.
3745
clippy_flags(

docs/flatten.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,8 +1439,8 @@ A toolchain for [rustfmt](https://rust-lang.github.io/rustfmt/)
14391439

14401440
<pre>
14411441
CrateInfo(<a href="#CrateInfo-aliases">aliases</a>, <a href="#CrateInfo-compile_data">compile_data</a>, <a href="#CrateInfo-compile_data_targets">compile_data_targets</a>, <a href="#CrateInfo-data">data</a>, <a href="#CrateInfo-deps">deps</a>, <a href="#CrateInfo-edition">edition</a>, <a href="#CrateInfo-is_test">is_test</a>, <a href="#CrateInfo-metadata">metadata</a>, <a href="#CrateInfo-name">name</a>,
1442-
<a href="#CrateInfo-output">output</a>, <a href="#CrateInfo-owner">owner</a>, <a href="#CrateInfo-proc_macro_deps">proc_macro_deps</a>, <a href="#CrateInfo-root">root</a>, <a href="#CrateInfo-rustc_env">rustc_env</a>, <a href="#CrateInfo-rustc_env_files">rustc_env_files</a>, <a href="#CrateInfo-srcs">srcs</a>, <a href="#CrateInfo-type">type</a>,
1443-
<a href="#CrateInfo-wrapped_crate_type">wrapped_crate_type</a>)
1442+
<a href="#CrateInfo-output">output</a>, <a href="#CrateInfo-owner">owner</a>, <a href="#CrateInfo-proc_macro_deps">proc_macro_deps</a>, <a href="#CrateInfo-root">root</a>, <a href="#CrateInfo-rustc_env">rustc_env</a>, <a href="#CrateInfo-rustc_env_files">rustc_env_files</a>, <a href="#CrateInfo-rustc_output">rustc_output</a>,
1443+
<a href="#CrateInfo-rustc_rmeta_output">rustc_rmeta_output</a>, <a href="#CrateInfo-srcs">srcs</a>, <a href="#CrateInfo-type">type</a>, <a href="#CrateInfo-wrapped_crate_type">wrapped_crate_type</a>)
14441444
</pre>
14451445

14461446
A provider containing general Crate information.
@@ -1457,14 +1457,16 @@ A provider containing general Crate information.
14571457
| <a id="CrateInfo-deps"></a>deps | depset[DepVariantInfo]: This crate's (rust or cc) dependencies' providers. |
14581458
| <a id="CrateInfo-edition"></a>edition | str: The edition of this crate. |
14591459
| <a id="CrateInfo-is_test"></a>is_test | bool: If the crate is being compiled in a test context |
1460-
| <a id="CrateInfo-metadata"></a>metadata | File: The rmeta file produced for this crate. It is optional. |
1460+
| <a id="CrateInfo-metadata"></a>metadata | File: The output from rustc from producing the output file. It is optional. |
14611461
| <a id="CrateInfo-name"></a>name | str: The name of this crate. |
14621462
| <a id="CrateInfo-output"></a>output | File: The output File that will be produced, depends on crate type. |
14631463
| <a id="CrateInfo-owner"></a>owner | Label: The label of the target that produced this CrateInfo |
14641464
| <a id="CrateInfo-proc_macro_deps"></a>proc_macro_deps | depset[DepVariantInfo]: This crate's rust proc_macro dependencies' providers. |
14651465
| <a id="CrateInfo-root"></a>root | File: The source File entrypoint to this crate, eg. lib.rs |
14661466
| <a id="CrateInfo-rustc_env"></a>rustc_env | Dict[String, String]: Additional <code>"key": "value"</code> environment variables to set for rustc. |
14671467
| <a id="CrateInfo-rustc_env_files"></a>rustc_env_files | [File]: Files containing additional environment variables to set for rustc. |
1468+
| <a id="CrateInfo-rustc_output"></a>rustc_output | File: The output from rustc from producing the output file. It is optional. |
1469+
| <a id="CrateInfo-rustc_rmeta_output"></a>rustc_rmeta_output | File: The rmeta file produced for this crate. It is optional. |
14681470
| <a id="CrateInfo-srcs"></a>srcs | depset[File]: All source Files that are part of the crate. |
14691471
| <a id="CrateInfo-type"></a>type | str: The type of this crate (see [rustc --crate-type](https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit)). |
14701472
| <a id="CrateInfo-wrapped_crate_type"></a>wrapped_crate_type | str, optional: The original crate type for targets generated using a previously defined crate (typically tests using the <code>rust_test::crate</code> attribute) |

docs/providers.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
<pre>
1313
CrateInfo(<a href="#CrateInfo-aliases">aliases</a>, <a href="#CrateInfo-compile_data">compile_data</a>, <a href="#CrateInfo-compile_data_targets">compile_data_targets</a>, <a href="#CrateInfo-data">data</a>, <a href="#CrateInfo-deps">deps</a>, <a href="#CrateInfo-edition">edition</a>, <a href="#CrateInfo-is_test">is_test</a>, <a href="#CrateInfo-metadata">metadata</a>, <a href="#CrateInfo-name">name</a>,
14-
<a href="#CrateInfo-output">output</a>, <a href="#CrateInfo-owner">owner</a>, <a href="#CrateInfo-proc_macro_deps">proc_macro_deps</a>, <a href="#CrateInfo-root">root</a>, <a href="#CrateInfo-rustc_env">rustc_env</a>, <a href="#CrateInfo-rustc_env_files">rustc_env_files</a>, <a href="#CrateInfo-srcs">srcs</a>, <a href="#CrateInfo-type">type</a>,
15-
<a href="#CrateInfo-wrapped_crate_type">wrapped_crate_type</a>)
14+
<a href="#CrateInfo-output">output</a>, <a href="#CrateInfo-owner">owner</a>, <a href="#CrateInfo-proc_macro_deps">proc_macro_deps</a>, <a href="#CrateInfo-root">root</a>, <a href="#CrateInfo-rustc_env">rustc_env</a>, <a href="#CrateInfo-rustc_env_files">rustc_env_files</a>, <a href="#CrateInfo-rustc_output">rustc_output</a>,
15+
<a href="#CrateInfo-rustc_rmeta_output">rustc_rmeta_output</a>, <a href="#CrateInfo-srcs">srcs</a>, <a href="#CrateInfo-type">type</a>, <a href="#CrateInfo-wrapped_crate_type">wrapped_crate_type</a>)
1616
</pre>
1717

1818
A provider containing general Crate information.
@@ -29,14 +29,16 @@ A provider containing general Crate information.
2929
| <a id="CrateInfo-deps"></a>deps | depset[DepVariantInfo]: This crate's (rust or cc) dependencies' providers. |
3030
| <a id="CrateInfo-edition"></a>edition | str: The edition of this crate. |
3131
| <a id="CrateInfo-is_test"></a>is_test | bool: If the crate is being compiled in a test context |
32-
| <a id="CrateInfo-metadata"></a>metadata | File: The rmeta file produced for this crate. It is optional. |
32+
| <a id="CrateInfo-metadata"></a>metadata | File: The output from rustc from producing the output file. It is optional. |
3333
| <a id="CrateInfo-name"></a>name | str: The name of this crate. |
3434
| <a id="CrateInfo-output"></a>output | File: The output File that will be produced, depends on crate type. |
3535
| <a id="CrateInfo-owner"></a>owner | Label: The label of the target that produced this CrateInfo |
3636
| <a id="CrateInfo-proc_macro_deps"></a>proc_macro_deps | depset[DepVariantInfo]: This crate's rust proc_macro dependencies' providers. |
3737
| <a id="CrateInfo-root"></a>root | File: The source File entrypoint to this crate, eg. lib.rs |
3838
| <a id="CrateInfo-rustc_env"></a>rustc_env | Dict[String, String]: Additional <code>"key": "value"</code> environment variables to set for rustc. |
3939
| <a id="CrateInfo-rustc_env_files"></a>rustc_env_files | [File]: Files containing additional environment variables to set for rustc. |
40+
| <a id="CrateInfo-rustc_output"></a>rustc_output | File: The output from rustc from producing the output file. It is optional. |
41+
| <a id="CrateInfo-rustc_rmeta_output"></a>rustc_rmeta_output | File: The rmeta file produced for this crate. It is optional. |
4042
| <a id="CrateInfo-srcs"></a>srcs | depset[File]: All source Files that are part of the crate. |
4143
| <a id="CrateInfo-type"></a>type | str: The type of this crate (see [rustc --crate-type](https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit)). |
4244
| <a id="CrateInfo-wrapped_crate_type"></a>wrapped_crate_type | str, optional: The original crate type for targets generated using a previously defined crate (typically tests using the <code>rust_test::crate</code> attribute) |

docs/rust_analyzer.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,16 @@ to ensure a `rust-project.json` file is created and up to date when the editor i
7878
}
7979
```
8080

81+
#### Alternative vscode option (prototype)
82+
83+
Add the following to your bazelrc:
84+
```
85+
build --@rules_rust//:output_diagnostics=true --output_groups=+rust_lib_rustc_output,+rust_metadata_rustc_output
86+
```
87+
88+
Then you can use a prototype [rust-analyzer plugin](https://marketplace.visualstudio.com/items?itemName=MattStark.bazel-rust-analyzer) that automatically collects the outputs whenever you recompile.
89+
90+
8191

8292
<a id="rust_analyzer_toolchain"></a>
8393

docs/rust_analyzer.vm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,14 @@ to ensure a `rust-project.json` file is created and up to date when the editor i
7171
]
7272
}
7373
```
74+
75+
#### Alternative vscode option (prototype)
76+
77+
Add the following to your bazelrc:
78+
```
79+
build --@rules_rust//:output_diagnostics=true --output_groups=+rust_lib_rustc_output,+rust_metadata_rustc_output
80+
```
81+
82+
Then you can use a prototype [rust-analyzer plugin](https://marketplace.visualstudio.com/items?itemName=MattStark.bazel-rust-analyzer) that automatically collects the outputs whenever you recompile.
83+
7484
]]#

rust/defs.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ load(
5252
_is_proc_macro_dep_enabled = "is_proc_macro_dep_enabled",
5353
_no_std = "no_std",
5454
_per_crate_rustc_flag = "per_crate_rustc_flag",
55+
_rustc_output_diagnostics = "rustc_output_diagnostics",
5556
)
5657
load(
5758
"//rust/private:rustdoc.bzl",
@@ -109,6 +110,9 @@ rust_clippy = _rust_clippy
109110
capture_clippy_output = _capture_clippy_output
110111
# See @rules_rust//rust/private:clippy.bzl for a complete description.
111112

113+
rustc_output_diagnostics = _rustc_output_diagnostics
114+
# See @rules_rust//rust/private:rustc.bzl for a complete description.
115+
112116
error_format = _error_format
113117
# See @rules_rust//rust/private:rustc.bzl for a complete description.
114118

rust/private/common.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ def _create_crate_info(**kwargs):
5151
kwargs.update({"wrapped_crate_type": None})
5252
if not "metadata" in kwargs:
5353
kwargs.update({"metadata": None})
54+
if not "rustc_rmeta_output" in kwargs:
55+
kwargs.update({"rustc_rmeta_output": None})
56+
if not "rustc_output" in kwargs:
57+
kwargs.update({"rustc_output": None})
5458
if not "rustc_env_files" in kwargs:
5559
kwargs.update({"rustc_env_files": []})
5660
if not "data" in kwargs:

rust/private/providers.bzl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ CrateInfo = provider(
2424
"deps": "depset[DepVariantInfo]: This crate's (rust or cc) dependencies' providers.",
2525
"edition": "str: The edition of this crate.",
2626
"is_test": "bool: If the crate is being compiled in a test context",
27-
"metadata": "File: The rmeta file produced for this crate. It is optional.",
27+
"metadata": "File: The output from rustc from producing the output file. It is optional.",
2828
"name": "str: The name of this crate.",
2929
"output": "File: The output File that will be produced, depends on crate type.",
3030
"owner": "Label: The label of the target that produced this CrateInfo",
3131
"proc_macro_deps": "depset[DepVariantInfo]: This crate's rust proc_macro dependencies' providers.",
3232
"root": "File: The source File entrypoint to this crate, eg. lib.rs",
3333
"rustc_env": "Dict[String, String]: Additional `\"key\": \"value\"` environment variables to set for rustc.",
3434
"rustc_env_files": "[File]: Files containing additional environment variables to set for rustc.",
35+
"rustc_output": "File: The output from rustc from producing the output file. It is optional.",
36+
"rustc_rmeta_output": "File: The rmeta file produced for this crate. It is optional.",
3537
"srcs": "depset[File]: All source Files that are part of the crate.",
3638
"type": (
3739
"str: The type of this crate " +
@@ -94,6 +96,16 @@ DepVariantInfo = provider(
9496
},
9597
)
9698

99+
RustcOutputDiagnosticsInfo = provider(
100+
doc = (
101+
"Save json diagnostics from rustc. Json diagnostics are able to be " +
102+
"consumed by tools such as rust-analyzer to provide IDE integration"
103+
),
104+
fields = {
105+
"rustc_output_diagnostics": "bool: Whether or not to output diagnostics",
106+
},
107+
)
108+
97109
StdLibInfo = provider(
98110
doc = (
99111
"A collection of files either found within the `rust-stdlib` artifact or " +

rust/private/rust.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ load(
2828
"determine_output_hash",
2929
"expand_dict_value_locations",
3030
"find_toolchain",
31+
"generate_output_diagnostics",
3132
"get_edition",
3233
"get_import_macro_deps",
3334
"transform_deps",
@@ -168,11 +169,13 @@ def _rust_library_common(ctx, crate_type):
168169
)
169170
rust_lib = ctx.actions.declare_file(rust_lib_name)
170171
rust_metadata = None
172+
rustc_rmeta_output = None
171173
if can_build_metadata(toolchain, ctx, crate_type) and not ctx.attr.disable_pipelining:
172174
rust_metadata = ctx.actions.declare_file(
173175
paths.replace_extension(rust_lib_name, ".rmeta"),
174176
sibling = rust_lib,
175177
)
178+
rustc_rmeta_output = generate_output_diagnostics(ctx, rust_metadata)
176179

177180
deps = transform_deps(ctx.attr.deps)
178181
proc_macro_deps = transform_deps(ctx.attr.proc_macro_deps + get_import_macro_deps(ctx))
@@ -191,7 +194,9 @@ def _rust_library_common(ctx, crate_type):
191194
proc_macro_deps = depset(proc_macro_deps),
192195
aliases = ctx.attr.aliases,
193196
output = rust_lib,
197+
rustc_output = generate_output_diagnostics(ctx, rust_lib),
194198
metadata = rust_metadata,
199+
rustc_rmeta_output = rustc_rmeta_output,
195200
edition = get_edition(ctx.attr, toolchain, ctx.label),
196201
rustc_env = ctx.attr.rustc_env,
197202
rustc_env_files = ctx.files.rustc_env_files,
@@ -239,6 +244,7 @@ def _rust_binary_impl(ctx):
239244
proc_macro_deps = depset(proc_macro_deps),
240245
aliases = ctx.attr.aliases,
241246
output = output,
247+
rustc_output = generate_output_diagnostics(ctx, output),
242248
edition = get_edition(ctx.attr, toolchain, ctx.label),
243249
rustc_env = ctx.attr.rustc_env,
244250
rustc_env_files = ctx.files.rustc_env_files,
@@ -312,6 +318,7 @@ def _rust_test_impl(ctx):
312318
proc_macro_deps = depset(proc_macro_deps, transitive = [crate.proc_macro_deps]),
313319
aliases = ctx.attr.aliases,
314320
output = output,
321+
rustc_output = generate_output_diagnostics(ctx, output),
315322
edition = crate.edition,
316323
rustc_env = rustc_env,
317324
rustc_env_files = rustc_env_files,
@@ -355,6 +362,7 @@ def _rust_test_impl(ctx):
355362
proc_macro_deps = depset(proc_macro_deps),
356363
aliases = ctx.attr.aliases,
357364
output = output,
365+
rustc_output = generate_output_diagnostics(ctx, output),
358366
edition = get_edition(ctx.attr, toolchain, ctx.label),
359367
rustc_env = rustc_env,
360368
rustc_env_files = ctx.files.rustc_env_files,
@@ -641,6 +649,9 @@ _common_attrs = {
641649
allow_single_file = True,
642650
cfg = "exec",
643651
),
652+
"_rustc_output_diagnostics": attr.label(
653+
default = Label("//:rustc_output_diagnostics"),
654+
),
644655
"_stamp_flag": attr.label(
645656
doc = "A setting used to determine whether or not the `--stamp` flag is enabled",
646657
default = Label("//rust/private:stamp"),

rust/private/rustc.bzl

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ load(
2323
"CPP_LINK_STATIC_LIBRARY_ACTION_NAME",
2424
)
2525
load("//rust/private:common.bzl", "rust_common")
26-
load("//rust/private:providers.bzl", _BuildInfo = "BuildInfo")
26+
load("//rust/private:providers.bzl", "RustcOutputDiagnosticsInfo", _BuildInfo = "BuildInfo")
2727
load("//rust/private:stamp.bzl", "is_stamping_enabled")
2828
load(
2929
"//rust/private:utils.bzl",
@@ -929,6 +929,10 @@ def construct_arguments(
929929
if build_metadata:
930930
# Configure process_wrapper to terminate rustc when metadata are emitted
931931
process_wrapper_flags.add("--rustc-quit-on-rmeta", "true")
932+
if crate_info.rustc_rmeta_output:
933+
process_wrapper_flags.add("--output-file", crate_info.rustc_rmeta_output.path)
934+
elif crate_info.rustc_output:
935+
process_wrapper_flags.add("--output-file", crate_info.rustc_output.path)
932936

933937
rustc_flags.add(error_format, format = "--error-format=%s")
934938

@@ -1112,9 +1116,9 @@ def rustc_compile_action(
11121116
"""
11131117
crate_info = rust_common.create_crate_info(**crate_info_dict)
11141118

1115-
build_metadata = None
1116-
if "metadata" in crate_info_dict:
1117-
build_metadata = crate_info_dict["metadata"]
1119+
build_metadata = crate_info_dict.get("metadata", None)
1120+
rustc_output = crate_info_dict.get("rustc_output", None)
1121+
rustc_rmeta_output = crate_info_dict.get("rustc_rmeta_output", None)
11181122

11191123
cc_toolchain, feature_configuration = find_cc_toolchain(ctx)
11201124

@@ -1193,7 +1197,7 @@ def rustc_compile_action(
11931197
build_flags_files = build_flags_files,
11941198
force_all_deps_direct = force_all_deps_direct,
11951199
stamp = stamp,
1196-
use_json_output = bool(build_metadata),
1200+
use_json_output = bool(build_metadata) or bool(rustc_output) or bool(rustc_rmeta_output),
11971201
skip_expanding_rustc_env = skip_expanding_rustc_env,
11981202
)
11991203

@@ -1256,6 +1260,8 @@ def rustc_compile_action(
12561260

12571261
# The action might generate extra output that we don't want to include in the `DefaultInfo` files.
12581262
action_outputs = list(outputs)
1263+
if rustc_output:
1264+
action_outputs.append(rustc_output)
12591265

12601266
# Rustc generates a pdb file (on Windows) or a dsym folder (on macos) so provide it in an output group for crate
12611267
# types that benefit from having debug information in a separate file.
@@ -1290,7 +1296,7 @@ def rustc_compile_action(
12901296
ctx.actions.run(
12911297
executable = ctx.executable._process_wrapper,
12921298
inputs = compile_inputs,
1293-
outputs = [build_metadata],
1299+
outputs = [build_metadata] + [x for x in [rustc_rmeta_output] if x],
12941300
env = env,
12951301
arguments = args_metadata.all,
12961302
mnemonic = "RustcMetadata",
@@ -1456,12 +1462,24 @@ def rustc_compile_action(
14561462

14571463
if toolchain.target_arch != "wasm32":
14581464
providers += establish_cc_info(ctx, attr, crate_info, toolchain, cc_toolchain, feature_configuration, interface_library)
1465+
1466+
output_group_info = {}
1467+
14591468
if pdb_file:
1460-
providers.append(OutputGroupInfo(pdb_file = depset([pdb_file])))
1469+
output_group_info["pdb_file"] = depset([pdb_file])
14611470
if dsym_folder:
1462-
providers.append(OutputGroupInfo(dsym_folder = depset([dsym_folder])))
1471+
output_group_info["dsym_folder"] = depset([dsym_folder])
14631472
if build_metadata:
1464-
providers.append(OutputGroupInfo(build_metadata = depset([build_metadata])))
1473+
output_group_info["build_metadata"] = depset([build_metadata])
1474+
if build_metadata:
1475+
output_group_info["build_metadata"] = depset([build_metadata])
1476+
if rustc_rmeta_output:
1477+
output_group_info["rustc_rmeta_output"] = depset([rustc_rmeta_output])
1478+
if rustc_output:
1479+
output_group_info["rustc_output"] = depset([rustc_output])
1480+
1481+
if output_group_info:
1482+
providers.append(OutputGroupInfo(**output_group_info))
14651483

14661484
return providers
14671485

@@ -2046,6 +2064,31 @@ error_format = rule(
20462064
build_setting = config.string(flag = True),
20472065
)
20482066

2067+
def _rustc_output_diagnostics_impl(ctx):
2068+
"""Implementation of the `rustc_output_diagnostics` rule
2069+
2070+
Args:
2071+
ctx (ctx): The rule's context object
2072+
2073+
Returns:
2074+
list: A list containing the RustcOutputDiagnosticsInfo provider
2075+
"""
2076+
return [RustcOutputDiagnosticsInfo(
2077+
rustc_output_diagnostics = ctx.build_setting_value,
2078+
)]
2079+
2080+
rustc_output_diagnostics = rule(
2081+
doc = (
2082+
"Setting this flag from the command line with `--@rules_rust//:rustc_output_diagnostics` " +
2083+
"makes rules_rust save rustc json output(suitable for consumption by rust-analyzer) in a file. " +
2084+
"These are accessible via the " +
2085+
"`rustc_rmeta_output`(for pipelined compilation) and `rustc_output` output groups. " +
2086+
"You can find these using `bazel cquery`"
2087+
),
2088+
implementation = _rustc_output_diagnostics_impl,
2089+
build_setting = config.bool(flag = True),
2090+
)
2091+
20492092
def _extra_rustc_flags_impl(ctx):
20502093
return ExtraRustcFlagsInfo(extra_rustc_flags = ctx.build_setting_value)
20512094

0 commit comments

Comments
 (0)