Lines Matching +full:- +full:a

65 <a id="capture_clippy_output"></a>
70 capture_clippy_output(<a href="#capture_clippy_output-name">name</a>)
73 Control whether to print clippy output or store it to a file, using the configured error_format.
79 | :------------- | :------------- | :------------- | :------------- | :------------- |
80 | <a id="capture_clippy_output-name"></a>name | A unique name for this target. | <a href="https:…
83 <a id="cargo_dep_env"></a>
88 cargo_dep_env(<a href="#cargo_dep_env-name">name</a>, <a href="#cargo_dep_env-src">src</a>, <a href…
91 A rule for generating variables for dependent `cargo_build_script`s without a build script. This is…
97 | :------------- | :------------- | :------------- | :------------- | :------------- |
98 | <a id="cargo_dep_env-name"></a>name | A unique name for this target. | <a href="https://bazel.…
99a id="cargo_dep_env-src"></a>src | File containing additional environment variables to set for bu…
100a id="cargo_dep_env-out_dir"></a>out_dir | Folder containing additional inputs when building all …
103 <a id="error_format"></a>
108 error_format(<a href="#error_format-name">name</a>)
111 …ange the [--error-format](https://doc.rust-lang.org/rustc/command-line-arguments.html#option-error
117 | :------------- | :------------- | :------------- | :------------- | :------------- |
118 | <a id="error_format-name"></a>name | A unique name for this target. | <a href="https://bazel.b…
121 <a id="extra_rustc_flag"></a>
126 extra_rustc_flag(<a href="#extra_rustc_flag-name">name</a>)
129 Add additional rustc_flag from the command line with `--@rules_rust//:extra_rustc_flag`. Multiple u…
135 | :------------- | :------------- | :------------- | :------------- | :------------- |
136 | <a id="extra_rustc_flag-name"></a>name | A unique name for this target. | <a href="https://baz…
139 <a id="extra_rustc_flags"></a>
144 extra_rustc_flags(<a href="#extra_rustc_flags-name">name</a>)
147--@rules_rust//:extra_rustc_flags`. This flag should only be used for flags that need to be applie…
153 | :------------- | :------------- | :------------- | :------------- | :------------- |
154 | <a id="extra_rustc_flags-name"></a>name | A unique name for this target. | <a href="https://ba…
157 <a id="incompatible_flag"></a>
162 incompatible_flag(<a href="#incompatible_flag-name">name</a>, <a href="#incompatible_flag-issue">is…
165 A rule defining an incompatible flag.
171 | :------------- | :------------- | :------------- | :------------- | :------------- |
172 | <a id="incompatible_flag-name"></a>name | A unique name for this target. | <a href="https://ba…
173 | <a id="incompatible_flag-issue"></a>issue | The link to the github issue associated with this fl…
176 <a id="rust_analyzer_toolchain"></a>
181a href="#rust_analyzer_toolchain-name">name</a>, <a href="#rust_analyzer_toolchain-proc_macro_srv"…
184 A toolchain for [rust-analyzer](https://rust-analyzer.github.io/).
190 | :------------- | :------------- | :------------- | :------------- | :------------- |
191 … <a id="rust_analyzer_toolchain-name"></a>name | A unique name for this target. | <a href="http…
192a id="rust_analyzer_toolchain-proc_macro_srv"></a>proc_macro_srv | The path to a `rust_analyzer_p…
193 | <a id="rust_analyzer_toolchain-rustc"></a>rustc | The path to a `rustc` binary. | <a href="htt…
194 | <a id="rust_analyzer_toolchain-rustc_srcs"></a>rustc_srcs | The source code of rustc. | <a hre…
197 <a id="rust_binary"></a>
202a href="#rust_binary-name">name</a>, <a href="#rust_binary-deps">deps</a>, <a href="#rust_binary-s…
203a href="#rust_binary-crate_root">crate_root</a>, <a href="#rust_binary-crate_type">crate_type</a>,…
204a href="#rust_binary-malloc">malloc</a>, <a href="#rust_binary-out_binary">out_binary</a>, <a href…
205 <a href="#rust_binary-stamp">stamp</a>, <a href="#rust_binary-version">version</a>)
208 Builds a Rust binary crate.
212 Suppose you have the following directory structure for a Rust project with a
213 library crate, `hello_lib`, and a binary crate, `hello_world` that uses the
236 pub fn new(greeting: &str) -> Greeter {
283 Target //examples/rust/hello_world:hello_world up-to-date:
284 bazel-bin/examples/rust/hello_world/hello_world
287 INFO: Running command line: bazel-bin/examples/rust/hello_world/hello_world
291 On Windows, a PDB file containing debugging information is available under
292 the key `pdb_file` in `OutputGroupInfo`. Similarly on macOS, a dSYM folder
299 | :------------- | :------------- | :------------- | :------------- | :------------- |
300 | <a id="rust_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.bu…
301a id="rust_binary-deps"></a>deps | List of other libraries to be linked to this library target.<b…
302a id="rust_binary-srcs"></a>srcs | List of Rust `.rs` source files used to build the library.<br>…
303a id="rust_binary-data"></a>data | List of files used by this rule at compile time and runtime.<b…
304a id="rust_binary-aliases"></a>aliases | Remap crates to a new name or moniker for linkage to thi…
305 | <a id="rust_binary-alwayslink"></a>alwayslink | If 1, any binary that depends (directly or indir…
306a id="rust_binary-compile_data"></a>compile_data | List of files used by this rule at compile tim…
307a id="rust_binary-crate_features"></a>crate_features | List of features to enable for this crate.…
308 | <a id="rust_binary-crate_name"></a>crate_name | Crate name to use for this target.<br><br>This m…
309a id="rust_binary-crate_root"></a>crate_root | The file that will be passed to `rustc` to be used…
310 … <a id="rust_binary-crate_type"></a>crate_type | Crate type that will be passed to `rustc` to be …
311 | <a id="rust_binary-edition"></a>edition | The rust edition to use for this crate. Defaults to th…
312a id="rust_binary-env"></a>env | Specifies additional environment variables to set when the targe…
313a id="rust_binary-experimental_use_cc_common_link"></a>experimental_use_cc_common_link | Whether …
314a id="rust_binary-linker_script"></a>linker_script | Link script to forward into linker via rustc…
315a id="rust_binary-malloc"></a>malloc | Override the default dependency on `malloc`.<br><br>By def…
316a id="rust_binary-out_binary"></a>out_binary | Force a target, regardless of it's `crate_type`, t…
317 … <a id="rust_binary-platform"></a>platform | Optional platform to transition the binary to. | <
318a id="rust_binary-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` targets used t…
319a id="rust_binary-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` environmen…
320a id="rust_binary-rustc_env_files"></a>rustc_env_files | Files containing additional environment …
321a id="rust_binary-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.<br><br…
322a id="rust_binary-stamp"></a>stamp | Whether to encode build information into the `Rustc` action.…
323 | <a id="rust_binary-version"></a>version | A version to inject in the cargo environment variable.…
326 <a id="rust_bindgen"></a>
331a href="#rust_bindgen-name">name</a>, <a href="#rust_bindgen-bindgen_flags">bindgen_flags</a>, <a
334 Generates a rust source file from a cc_library and a header.
340 | :------------- | :------------- | :------------- | :------------- | :------------- |
341 | <a id="rust_bindgen-name"></a>name | A unique name for this target. | <a href="https://bazel.b…
342 | <a id="rust_bindgen-bindgen_flags"></a>bindgen_flags | Flags to pass directly to the bindgen exe…
343a id="rust_bindgen-cc_lib"></a>cc_lib | The cc_library that contains the `.h` file. This is used …
344 | <a id="rust_bindgen-clang_flags"></a>clang_flags | Flags to pass directly to the clang executabl…
345 | <a id="rust_bindgen-header"></a>header | The `.h` file to generate bindings for. | <a href="ht…
346 | <a id="rust_bindgen-wrap_static_fns"></a>wrap_static_fns | Whether to create a separate .c file …
349 <a id="rust_bindgen_toolchain"></a>
354a href="#rust_bindgen_toolchain-name">name</a>, <a href="#rust_bindgen_toolchain-bindgen">bindgen<…
360 in turn depends on both a clang binary and the clang library. To obtain these dependencies,
388 | :------------- | :------------- | :------------- | :------------- | :------------- |
389 … <a id="rust_bindgen_toolchain-name"></a>name | A unique name for this target. | <a href="https…
390 … <a id="rust_bindgen_toolchain-bindgen"></a>bindgen | The label of a `bindgen` executable. | <a
391 | <a id="rust_bindgen_toolchain-clang"></a>clang | The label of a `clang` executable. | <a href=…
392 | <a id="rust_bindgen_toolchain-default_rustfmt"></a>default_rustfmt | If set, `rust_bindgen` targ…
393a id="rust_bindgen_toolchain-libclang"></a>libclang | A cc_library that provides bindgen's runtim…
394a id="rust_bindgen_toolchain-libstdcxx"></a>libstdcxx | A cc_library that satisfies libclang's li…
397 <a id="rust_clippy"></a>
402 rust_clippy(<a href="#rust_clippy-name">name</a>, <a href="#rust_clippy-deps">deps</a>)
405 Executes the clippy checker on a specific target.
407 Similar to `rust_clippy_aspect`, but allows specifying a list of dependencies within the build syst…
426 Rust clippy can be set as a build target with the following:
445 | :------------- | :------------- | :------------- | :------------- | :------------- |
446 | <a id="rust_clippy-name"></a>name | A unique name for this target. | <a href="https://bazel.bu…
447 | <a id="rust_clippy-deps"></a>deps | Rust targets to run clippy on. | <a href="https://bazel.bu…
450 <a id="rust_doc"></a>
455a href="#rust_doc-name">name</a>, <a href="#rust_doc-crate">crate</a>, <a href="#rust_doc-html_aft…
456 …<a href="#rust_doc-rustc_flags">rustc_flags</a>, <a href="#rust_doc-rustdoc_flags">rustdoc_flags</
462 Suppose you have the following directory structure for a Rust library crate:
473 To build [`rustdoc`][rustdoc] documentation for the `hello_lib` crate, define a `rust_doc` rule…
475 [rustdoc]: https://doc.rust-lang.org/book/documentation.html
493 Running `bazel build //hello_lib:hello_lib_doc` will build a zip file containing the documentat…
499 | :------------- | :------------- | :------------- | :------------- | :------------- |
500 | <a id="rust_doc-name"></a>name | A unique name for this target. | <a href="https://bazel.build…
501a id="rust_doc-crate"></a>crate | The label of the target to generate code documentation for.<br>…
502a id="rust_doc-html_after_content"></a>html_after_content | File to add in `<body>`, after conten…
503a id="rust_doc-html_before_content"></a>html_before_content | File to add in `<body>`, before con…
504 | <a id="rust_doc-html_in_header"></a>html_in_header | File to add to `<head>`. | <a href="https…
505a id="rust_doc-markdown_css"></a>markdown_css | CSS files to include via `<link>` in a rendered M…
506 | <a id="rust_doc-rustc_flags"></a>rustc_flags | **Deprecated**: use `rustdoc_flags` instead | L…
507a id="rust_doc-rustdoc_flags"></a>rustdoc_flags | List of flags passed to `rustdoc`.<br><br>These…
510 <a id="rust_doc_test"></a>
515 rust_doc_test(<a href="#rust_doc_test-name">name</a>, <a href="#rust_doc_test-deps">deps</a>, <a hr…
522 Suppose you have the following directory structure for a Rust library crate:
533 To run [documentation tests][doc-test] for the `hello_lib` crate, define a `rust_doc_test` …
535 [doc-test]: https://doc.rust-lang.org/book/documentation.html#documentation-as-tests
559 | :------------- | :------------- | :------------- | :------------- | :------------- |
560 | <a id="rust_doc_test-name"></a>name | A unique name for this target. | <a href="https://bazel.…
561a id="rust_doc_test-deps"></a>deps | List of other libraries to be linked to this library target.…
562a id="rust_doc_test-crate"></a>crate | The label of the target to generate code documentation for…
565 <a id="rust_grpc_library"></a>
570a href="#rust_grpc_library-name">name</a>, <a href="#rust_grpc_library-deps">deps</a>, <a href="#r…
573 Builds a Rust library crate from a set of `proto_library`s suitable for gRPC.
601 | :------------- | :------------- | :------------- | :------------- | :------------- |
602 | <a id="rust_grpc_library-name"></a>name | A unique name for this target. | <a href="https://ba…
603a id="rust_grpc_library-deps"></a>deps | List of proto_library dependencies that will be built. O…
604 | <a id="rust_grpc_library-crate_name"></a>crate_name | Crate name to use for this target.<br><br>…
605a id="rust_grpc_library-rust_deps"></a>rust_deps | The crates the generated library depends on. …
606a id="rust_grpc_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.<…
609 <a id="rust_library"></a>
614a href="#rust_library-name">name</a>, <a href="#rust_library-deps">deps</a>, <a href="#rust_librar…
615a href="#rust_library-crate_root">crate_root</a>, <a href="#rust_library-disable_pipelining">disab…
616 …<a href="#rust_library-rustc_flags">rustc_flags</a>, <a href="#rust_library-stamp">stamp</a>, <a h…
619 Builds a Rust library crate.
623 Suppose you have the following directory structure for a simple Rust library crate:
642 pub fn new(greeting: &str) -> Greeter {
677 Target //examples/rust/hello_lib:hello_lib up-to-date:
678 bazel-bin/examples/rust/hello_lib/libhello_lib.rlib
686 | :------------- | :------------- | :------------- | :------------- | :------------- |
687 | <a id="rust_library-name"></a>name | A unique name for this target. | <a href="https://bazel.b…
688a id="rust_library-deps"></a>deps | List of other libraries to be linked to this library target.<…
689a id="rust_library-srcs"></a>srcs | List of Rust `.rs` source files used to build the library.<br…
690a id="rust_library-data"></a>data | List of files used by this rule at compile time and runtime.<…
691a id="rust_library-aliases"></a>aliases | Remap crates to a new name or moniker for linkage to th…
692 | <a id="rust_library-alwayslink"></a>alwayslink | If 1, any binary that depends (directly or indi…
693a id="rust_library-compile_data"></a>compile_data | List of files used by this rule at compile ti…
694a id="rust_library-crate_features"></a>crate_features | List of features to enable for this crate…
695 | <a id="rust_library-crate_name"></a>crate_name | Crate name to use for this target.<br><br>This …
696a id="rust_library-crate_root"></a>crate_root | The file that will be passed to `rustc` to be use…
697a id="rust_library-disable_pipelining"></a>disable_pipelining | Disables pipelining for this rule…
698 | <a id="rust_library-edition"></a>edition | The rust edition to use for this crate. Defaults to t…
699a id="rust_library-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` targets used …
700a id="rust_library-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` environme…
701a id="rust_library-rustc_env_files"></a>rustc_env_files | Files containing additional environment…
702a id="rust_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.<br><b…
703a id="rust_library-stamp"></a>stamp | Whether to encode build information into the `Rustc` action…
704 | <a id="rust_library-version"></a>version | A version to inject in the cargo environment variable…
707 <a id="rust_library_group"></a>
712 rust_library_group(<a href="#rust_library_group-name">name</a>, <a href="#rust_library_group-deps">…
715 Functions as an alias for a set of dependencies.
752 | :------------- | :------------- | :------------- | :------------- | :------------- |
753 | <a id="rust_library_group-name"></a>name | A unique name for this target. | <a href="https://b…
754a id="rust_library_group-deps"></a>deps | Other dependencies to forward through this crate group.…
757 <a id="rust_proc_macro"></a>
762a href="#rust_proc_macro-name">name</a>, <a href="#rust_proc_macro-deps">deps</a>, <a href="#rust_…
763a href="#rust_proc_macro-crate_name">crate_name</a>, <a href="#rust_proc_macro-crate_root">crate_r…
764 …<a href="#rust_proc_macro-rustc_flags">rustc_flags</a>, <a href="#rust_proc_macro-stamp">stamp</a>…
767 Builds a Rust proc-macro crate.
773 | :------------- | :------------- | :------------- | :------------- | :------------- |
774 | <a id="rust_proc_macro-name"></a>name | A unique name for this target. | <a href="https://baze…
775a id="rust_proc_macro-deps"></a>deps | List of other libraries to be linked to this library targe…
776a id="rust_proc_macro-srcs"></a>srcs | List of Rust `.rs` source files used to build the library.…
777a id="rust_proc_macro-data"></a>data | List of files used by this rule at compile time and runtim…
778a id="rust_proc_macro-aliases"></a>aliases | Remap crates to a new name or moniker for linkage to…
779 | <a id="rust_proc_macro-alwayslink"></a>alwayslink | If 1, any binary that depends (directly or i…
780a id="rust_proc_macro-compile_data"></a>compile_data | List of files used by this rule at compile…
781a id="rust_proc_macro-crate_features"></a>crate_features | List of features to enable for this cr…
782 | <a id="rust_proc_macro-crate_name"></a>crate_name | Crate name to use for this target.<br><br>Th…
783a id="rust_proc_macro-crate_root"></a>crate_root | The file that will be passed to `rustc` to be …
784 | <a id="rust_proc_macro-edition"></a>edition | The rust edition to use for this crate. Defaults t…
785a id="rust_proc_macro-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` targets us…
786a id="rust_proc_macro-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` enviro…
787a id="rust_proc_macro-rustc_env_files"></a>rustc_env_files | Files containing additional environm…
788a id="rust_proc_macro-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.<br…
789a id="rust_proc_macro-stamp"></a>stamp | Whether to encode build information into the `Rustc` act…
790 | <a id="rust_proc_macro-version"></a>version | A version to inject in the cargo environment varia…
793 <a id="rust_prost_toolchain"></a>
798a href="#rust_prost_toolchain-name">name</a>, <a href="#rust_prost_toolchain-prost_opts">prost_opt…
799a href="#rust_prost_toolchain-proto_compiler">proto_compiler</a>, <a href="#rust_prost_toolchain-t…
808 | :------------- | :------------- | :------------- | :------------- | :------------- |
809 | <a id="rust_prost_toolchain-name"></a>name | A unique name for this target. | <a href="https:/…
810 | <a id="rust_prost_toolchain-prost_opts"></a>prost_opts | Additional options to add to Prost. |…
811a id="rust_prost_toolchain-prost_plugin"></a>prost_plugin | Additional plugins to add to Prost. …
812a id="rust_prost_toolchain-prost_plugin_flag"></a>prost_plugin_flag | Prost plugin flag format. (…
813a id="rust_prost_toolchain-prost_runtime"></a>prost_runtime | The Prost runtime crates to use. …
814 … <a id="rust_prost_toolchain-prost_types"></a>prost_types | The Prost types crates to use. | <a
815a id="rust_prost_toolchain-proto_compiler"></a>proto_compiler | The protoc compiler to use. Note …
816 | <a id="rust_prost_toolchain-tonic_opts"></a>tonic_opts | Additional options to add to Tonic. |…
817a id="rust_prost_toolchain-tonic_plugin"></a>tonic_plugin | Additional plugins to add to Tonic. …
818a id="rust_prost_toolchain-tonic_plugin_flag"></a>tonic_plugin_flag | Tonic plugin flag format. (…
819a id="rust_prost_toolchain-tonic_runtime"></a>tonic_runtime | The Tonic runtime crates to use. …
822 <a id="rust_proto_library"></a>
827a href="#rust_proto_library-name">name</a>, <a href="#rust_proto_library-deps">deps</a>, <a href="…
830 Builds a Rust library crate from a set of `proto_library`s.
858 | :------------- | :------------- | :------------- | :------------- | :------------- |
859 | <a id="rust_proto_library-name"></a>name | A unique name for this target. | <a href="https://b…
860a id="rust_proto_library-deps"></a>deps | List of proto_library dependencies that will be built. …
861 | <a id="rust_proto_library-crate_name"></a>crate_name | Crate name to use for this target.<br><br…
862a id="rust_proto_library-rust_deps"></a>rust_deps | The crates the generated library depends on. …
863a id="rust_proto_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.…
866 <a id="rust_shared_library"></a>
871a href="#rust_shared_library-name">name</a>, <a href="#rust_shared_library-deps">deps</a>, <a href…
872a href="#rust_shared_library-crate_name">crate_name</a>, <a href="#rust_shared_library-crate_root"…
873a href="#rust_shared_library-platform">platform</a>, <a href="#rust_shared_library-proc_macro_deps…
874 <a href="#rust_shared_library-version">version</a>)
877 Builds a Rust shared library.
881 (for example to produce a shared library that Python program links against).
891 | :------------- | :------------- | :------------- | :------------- | :------------- |
892 | <a id="rust_shared_library-name"></a>name | A unique name for this target. | <a href="https://…
893a id="rust_shared_library-deps"></a>deps | List of other libraries to be linked to this library t…
894a id="rust_shared_library-srcs"></a>srcs | List of Rust `.rs` source files used to build the libr…
895a id="rust_shared_library-data"></a>data | List of files used by this rule at compile time and ru…
896a id="rust_shared_library-aliases"></a>aliases | Remap crates to a new name or moniker for linkag…
897 | <a id="rust_shared_library-alwayslink"></a>alwayslink | If 1, any binary that depends (directly …
898a id="rust_shared_library-compile_data"></a>compile_data | List of files used by this rule at com…
899a id="rust_shared_library-crate_features"></a>crate_features | List of features to enable for thi…
900 | <a id="rust_shared_library-crate_name"></a>crate_name | Crate name to use for this target.<br><b…
901a id="rust_shared_library-crate_root"></a>crate_root | The file that will be passed to `rustc` to…
902 | <a id="rust_shared_library-edition"></a>edition | The rust edition to use for this crate. Defaul…
903a id="rust_shared_library-experimental_use_cc_common_link"></a>experimental_use_cc_common_link | …
904a id="rust_shared_library-malloc"></a>malloc | Override the default dependency on `malloc`.<br><b…
905a id="rust_shared_library-platform"></a>platform | Optional platform to transition the shared lib…
906a id="rust_shared_library-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` target…
907a id="rust_shared_library-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` en…
908a id="rust_shared_library-rustc_env_files"></a>rustc_env_files | Files containing additional envi…
909a id="rust_shared_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`…
910a id="rust_shared_library-stamp"></a>stamp | Whether to encode build information into the `Rustc`…
911 | <a id="rust_shared_library-version"></a>version | A version to inject in the cargo environment v…
914 <a id="rust_static_library"></a>
919a href="#rust_static_library-name">name</a>, <a href="#rust_static_library-deps">deps</a>, <a href…
920a href="#rust_static_library-crate_name">crate_name</a>, <a href="#rust_static_library-crate_root"…
921a href="#rust_static_library-rustc_env_files">rustc_env_files</a>, <a href="#rust_static_library-r…
924 Builds a Rust static library.
938 | :------------- | :------------- | :------------- | :------------- | :------------- |
939 | <a id="rust_static_library-name"></a>name | A unique name for this target. | <a href="https://…
940a id="rust_static_library-deps"></a>deps | List of other libraries to be linked to this library t…
941a id="rust_static_library-srcs"></a>srcs | List of Rust `.rs` source files used to build the libr…
942a id="rust_static_library-data"></a>data | List of files used by this rule at compile time and ru…
943a id="rust_static_library-aliases"></a>aliases | Remap crates to a new name or moniker for linkag…
944 | <a id="rust_static_library-alwayslink"></a>alwayslink | If 1, any binary that depends (directly …
945a id="rust_static_library-compile_data"></a>compile_data | List of files used by this rule at com…
946a id="rust_static_library-crate_features"></a>crate_features | List of features to enable for thi…
947 | <a id="rust_static_library-crate_name"></a>crate_name | Crate name to use for this target.<br><b…
948a id="rust_static_library-crate_root"></a>crate_root | The file that will be passed to `rustc` to…
949 | <a id="rust_static_library-edition"></a>edition | The rust edition to use for this crate. Defaul…
950a id="rust_static_library-platform"></a>platform | Optional platform to transition the static lib…
951a id="rust_static_library-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` target…
952a id="rust_static_library-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` en…
953a id="rust_static_library-rustc_env_files"></a>rustc_env_files | Files containing additional envi…
954a id="rust_static_library-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`…
955a id="rust_static_library-stamp"></a>stamp | Whether to encode build information into the `Rustc`…
956 | <a id="rust_static_library-version"></a>version | A version to inject in the cargo environment v…
959 <a id="rust_stdlib_filegroup"></a>
964 rust_stdlib_filegroup(<a href="#rust_stdlib_filegroup-name">name</a>, <a href="#rust_stdlib_filegro…
967 A dedicated filegroup-like rule for Rust stdlib artifacts.
973 | :------------- | :------------- | :------------- | :------------- | :------------- |
974 | <a id="rust_stdlib_filegroup-name"></a>name | A unique name for this target. | <a href="https:…
975a id="rust_stdlib_filegroup-srcs"></a>srcs | The list of targets/files that are components of the…
978 <a id="rust_test"></a>
983a href="#rust_test-name">name</a>, <a href="#rust_test-deps">deps</a>, <a href="#rust_test-srcs">s…
984a href="#rust_test-crate_name">crate_name</a>, <a href="#rust_test-crate_root">crate_root</a>, <a
985a href="#rust_test-proc_macro_deps">proc_macro_deps</a>, <a href="#rust_test-rustc_env">rustc_env<…
986 <a href="#rust_test-version">version</a>)
989 Builds a Rust test crate.
993 Suppose you have the following directory structure for a Rust library crate with unit test …
1011 pub fn new(greeting: &str) -> Greeter {
1015 pub fn greet(&self, thing: &str) -> String {
1032 To build and run the tests, simply add a `rust_test` rule with no `srcs`
1059 Integration tests that live in the [`tests` directory][int-tests], they are essentially bui…
1061 [int-tests]: http://doc.rust-lang.org/book/testing.html#the-tests-directory
1087 To build the `greeting.rs` integration test, simply add a `rust_test` target
1088 with `greeting.rs` in `srcs` and a dependency on the `hello_lib` target:
1112 | :------------- | :------------- | :------------- | :------------- | :------------- |
1113 | <a id="rust_test-name"></a>name | A unique name for this target. | <a href="https://bazel.buil…
1114a id="rust_test-deps"></a>deps | List of other libraries to be linked to this library target.<br>…
1115a id="rust_test-srcs"></a>srcs | List of Rust `.rs` source files used to build the library.<br><b…
1116a id="rust_test-data"></a>data | List of files used by this rule at compile time and runtime.<br>…
1117a id="rust_test-aliases"></a>aliases | Remap crates to a new name or moniker for linkage to this …
1118 | <a id="rust_test-alwayslink"></a>alwayslink | If 1, any binary that depends (directly or indirec…
1119a id="rust_test-compile_data"></a>compile_data | List of files used by this rule at compile time.…
1120a id="rust_test-crate"></a>crate | Target inline tests declared in the given crate<br><br>These t…
1121a id="rust_test-crate_features"></a>crate_features | List of features to enable for this crate.<b…
1122 | <a id="rust_test-crate_name"></a>crate_name | Crate name to use for this target.<br><br>This mus…
1123a id="rust_test-crate_root"></a>crate_root | The file that will be passed to `rustc` to be used f…
1124 | <a id="rust_test-edition"></a>edition | The rust edition to use for this crate. Defaults to the …
1125a id="rust_test-env"></a>env | Specifies additional environment variables to set when the test is…
1126a id="rust_test-experimental_use_cc_common_link"></a>experimental_use_cc_common_link | Whether to…
1127a id="rust_test-malloc"></a>malloc | Override the default dependency on `malloc`.<br><br>By defau…
1128 | <a id="rust_test-platform"></a>platform | Optional platform to transition the test to. | <a hr…
1129a id="rust_test-proc_macro_deps"></a>proc_macro_deps | List of `rust_proc_macro` targets used to …
1130a id="rust_test-rustc_env"></a>rustc_env | Dictionary of additional `"key": "value"` environment …
1131a id="rust_test-rustc_env_files"></a>rustc_env_files | Files containing additional environment va…
1132a id="rust_test-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc`.<br><br>T…
1133a id="rust_test-stamp"></a>stamp | Whether to encode build information into the `Rustc` action. P…
1134a id="rust_test-use_libtest_harness"></a>use_libtest_harness | Whether to use `libtest`. For targ…
1135 | <a id="rust_test-version"></a>version | A version to inject in the cargo environment variable. …
1138 <a id="rust_toolchain"></a>
1143a href="#rust_toolchain-name">name</a>, <a href="#rust_toolchain-allocator_library">allocator_libr…
1144a href="#rust_toolchain-default_edition">default_edition</a>, <a href="#rust_toolchain-dylib_ext">…
1145a href="#rust_toolchain-experimental_use_cc_common_link">experimental_use_cc_common_link</a>, <a h…
1146a href="#rust_toolchain-extra_rustc_flags_for_crate_types">extra_rustc_flags_for_crate_types</a>, …
1147a href="#rust_toolchain-llvm_tools">llvm_tools</a>, <a href="#rust_toolchain-opt_level">opt_level<…
1148a href="#rust_toolchain-rustfmt">rustfmt</a>, <a href="#rust_toolchain-staticlib_ext">staticlib_ex…
1151 Declares a Rust toolchain for use.
1153 This is for declaring a custom toolchain, eg. for configuring a particular version of rust or suppo…
1157 …ust team has ported the compiler to a new target CPU, called `cpuX`. This support can be used in B…
1166 exec_triple = "cpuX-unknown-linux-gnu",
1171 staticlib_ext = ".a",
1172 stdlib_linkflags = ["-lpthread", "-ldl"],
1173 target_triple = "cpuX-unknown-linux-gnu",
1190 …lchain rule to `register_toolchains` in the WORKSPACE, or pass it to the `"--extra_toolchains"` fl…
1198 | :------------- | :------------- | :------------- | :------------- | :------------- |
1199 | <a id="rust_toolchain-name"></a>name | A unique name for this target. | <a href="https://bazel…
1200a id="rust_toolchain-allocator_library"></a>allocator_library | Target that provides allocator fu…
1201 | <a id="rust_toolchain-binary_ext"></a>binary_ext | The extension for binaries created from rustc…
1202a id="rust_toolchain-cargo"></a>cargo | The location of the `cargo` binary. Can be a direct sourc…
1203a id="rust_toolchain-cargo_clippy"></a>cargo_clippy | The location of the `cargo_clippy` binary. …
1204a id="rust_toolchain-clippy_driver"></a>clippy_driver | The location of the `clippy-driver` binar…
1205a id="rust_toolchain-debug_info"></a>debug_info | Rustc debug info levels per opt level | <a hr…
1206 | <a id="rust_toolchain-default_edition"></a>default_edition | The edition to use for rust_* rules…
1207 | <a id="rust_toolchain-dylib_ext"></a>dylib_ext | The extension for dynamic libraries created fro…
1208a id="rust_toolchain-env"></a>env | Environment variables to set in actions. | <a href="https:/…
1209 | <a id="rust_toolchain-exec_triple"></a>exec_triple | The platform triple for the toolchains exec…
1210a id="rust_toolchain-experimental_link_std_dylib"></a>experimental_link_std_dylib | Label to a bo…
1211a id="rust_toolchain-experimental_use_cc_common_link"></a>experimental_use_cc_common_link | Label…
1212 | <a id="rust_toolchain-extra_exec_rustc_flags"></a>extra_exec_rustc_flags | Extra flags to pass t…
1213 | <a id="rust_toolchain-extra_rustc_flags"></a>extra_rustc_flags | Extra flags to pass to rustc in…
1214a id="rust_toolchain-extra_rustc_flags_for_crate_types"></a>extra_rustc_flags_for_crate_types | E…
1215a id="rust_toolchain-global_allocator_library"></a>global_allocator_library | Target that provide…
1216a id="rust_toolchain-llvm_cov"></a>llvm_cov | The location of the `llvm-cov` binary. Can be a dir…
1217a id="rust_toolchain-llvm_profdata"></a>llvm_profdata | The location of the `llvm-profdata` binar…
1218a id="rust_toolchain-llvm_tools"></a>llvm_tools | LLVM tools that are shipped with the Rust toolc…
1219a id="rust_toolchain-opt_level"></a>opt_level | Rustc optimization levels. | <a href="https://b…
1220 | <a id="rust_toolchain-per_crate_rustc_flags"></a>per_crate_rustc_flags | Extra flags to pass to …
1221a id="rust_toolchain-rust_doc"></a>rust_doc | The location of the `rustdoc` binary. Can be a dire…
1222 | <a id="rust_toolchain-rust_std"></a>rust_std | The Rust standard library. | <a href="https://b…
1223a id="rust_toolchain-rustc"></a>rustc | The location of the `rustc` binary. Can be a direct sourc…
1224a id="rust_toolchain-rustc_lib"></a>rustc_lib | The libraries used by rustc during compilation. …
1225a id="rust_toolchain-rustfmt"></a>rustfmt | **Deprecated**: Instead see [rustfmt_toolchain](#rust…
1226 | <a id="rust_toolchain-staticlib_ext"></a>staticlib_ext | The extension for static libraries crea…
1227 | <a id="rust_toolchain-stdlib_linkflags"></a>stdlib_linkflags | Additional linker flags to use wh…
1228a id="rust_toolchain-strip_level"></a>strip_level | Rustc strip levels. For all potential options…
1229a id="rust_toolchain-target_json"></a>target_json | Override the target_triple with a custom targ…
1230 | <a id="rust_toolchain-target_triple"></a>target_triple | The platform triple for the toolchains …
1233 <a id="rust_wasm_bindgen"></a>
1238a href="#rust_wasm_bindgen-name">name</a>, <a href="#rust_wasm_bindgen-bindgen_flags">bindgen_flag…
1241 Generates javascript and typescript bindings for a webassembly module using [wasm-bindgen][ws].
1243 [ws]: https://rustwasm.github.io/docs/wasm-bindgen/
1251 | :------------- | :------------- | :------------- | :------------- | :------------- |
1252 | <a id="rust_wasm_bindgen-name"></a>name | A unique name for this target. | <a href="https://ba…
1253 | <a id="rust_wasm_bindgen-bindgen_flags"></a>bindgen_flags | Flags to pass directly to the bindge…
1254 | <a id="rust_wasm_bindgen-target"></a>target | The type of output to generate. See https://rustwa…
1255a id="rust_wasm_bindgen-wasm_file"></a>wasm_file | The `.wasm` file or crate to generate bindings…
1258 <a id="rust_wasm_bindgen_toolchain"></a>
1263 …m_bindgen_toolchain(<a href="#rust_wasm_bindgen_toolchain-name">name</a>, <a href="#rust_wasm_bind…
1268 In cases where users want to control or change the version of `wasm-bindgen` used by [rust_wasm_bin…
1269 a unique toolchain can be created as in the example below:
1300 | :------------- | :------------- | :------------- | :------------- | :------------- |
1301a id="rust_wasm_bindgen_toolchain-name"></a>name | A unique name for this target. | <a href="ht…
1302a id="rust_wasm_bindgen_toolchain-bindgen"></a>bindgen | The label of a `wasm-bindgen-cli` execut…
1305 <a id="rustfmt_test"></a>
1310 rustfmt_test(<a href="#rustfmt_test-name">name</a>, <a href="#rustfmt_test-targets">targets</a>)
1313 A test rule for performing `rustfmt --check` on a set of targets
1319 | :------------- | :------------- | :------------- | :------------- | :------------- |
1320 | <a id="rustfmt_test-name"></a>name | A unique name for this target. | <a href="https://bazel.b…
1321a id="rustfmt_test-targets"></a>targets | Rust targets to run `rustfmt --check` on. | <a href="…
1324 <a id="rustfmt_toolchain"></a>
1329a href="#rustfmt_toolchain-name">name</a>, <a href="#rustfmt_toolchain-rustc">rustc</a>, <a href="…
1332 A toolchain for [rustfmt](https://rust-lang.github.io/rustfmt/)
1338 | :------------- | :------------- | :------------- | :------------- | :------------- |
1339 | <a id="rustfmt_toolchain-name"></a>name | A unique name for this target. | <a href="https://ba…
1340a id="rustfmt_toolchain-rustc"></a>rustc | The location of the `rustc` binary. Can be a direct so…
1341a id="rustfmt_toolchain-rustc_lib"></a>rustc_lib | The libraries used by rustc during compilation…
1342a id="rustfmt_toolchain-rustfmt"></a>rustfmt | The location of the `rustfmt` binary. Can be a dir…
1345 <a id="CrateInfo"></a>
1350a href="#CrateInfo-aliases">aliases</a>, <a href="#CrateInfo-compile_data">compile_data</a>, <a hr…
1351a href="#CrateInfo-output">output</a>, <a href="#CrateInfo-owner">owner</a>, <a href="#CrateInfo-p…
1352a href="#CrateInfo-rustc_rmeta_output">rustc_rmeta_output</a>, <a href="#CrateInfo-srcs">srcs</a>,…
1355 A provider containing general Crate information.
1361 | :------------- | :------------- |
1362 | <a id="CrateInfo-aliases"></a>aliases | Dict[Label, String]: Renamed and aliased crates |
1363 | <a id="CrateInfo-compile_data"></a>compile_data | depset[File]: Compile data required by this cr…
1364 | <a id="CrateInfo-compile_data_targets"></a>compile_data_targets | depset[Label]: Compile data ta…
1365 | <a id="CrateInfo-data"></a>data | depset[File]: Compile data required by crates that use the cur…
1366 | <a id="CrateInfo-deps"></a>deps | depset[DepVariantInfo]: This crate's (rust or cc) dependencies…
1367 | <a id="CrateInfo-edition"></a>edition | str: The edition of this crate. |
1368 | <a id="CrateInfo-is_test"></a>is_test | bool: If the crate is being compiled in a test context …
1369 | <a id="CrateInfo-metadata"></a>metadata | File: The output from rustc from producing the output …
1370 | <a id="CrateInfo-name"></a>name | str: The name of this crate. |
1371 | <a id="CrateInfo-output"></a>output | File: The output File that will be produced, depends on cr…
1372 | <a id="CrateInfo-owner"></a>owner | Label: The label of the target that produced this CrateInfo …
1373 | <a id="CrateInfo-proc_macro_deps"></a>proc_macro_deps | depset[DepVariantInfo]: This crate's rus…
1374 | <a id="CrateInfo-root"></a>root | File: The source File entrypoint to this crate, eg. lib.rs |
1375 | <a id="CrateInfo-rustc_env"></a>rustc_env | Dict[String, String]: Additional `"key": "value"` en…
1376 | <a id="CrateInfo-rustc_env_files"></a>rustc_env_files | [File]: Files containing additional envi…
1377 | <a id="CrateInfo-rustc_output"></a>rustc_output | File: The output from rustc from producing the…
1378 | <a id="CrateInfo-rustc_rmeta_output"></a>rustc_rmeta_output | File: The rmeta file produced for …
1379 | <a id="CrateInfo-srcs"></a>srcs | depset[File]: All source Files that are part of the crate. |
1380 | <a id="CrateInfo-std_dylib"></a>std_dylib | File: libstd.so file |
1381a id="CrateInfo-type"></a>type | str: The type of this crate (see [rustc --crate-type](https://do…
1382 | <a id="CrateInfo-wrapped_crate_type"></a>wrapped_crate_type | str, optional: The original crate …
1385 <a id="DepInfo"></a>
1390a href="#DepInfo-dep_env">dep_env</a>, <a href="#DepInfo-direct_crates">direct_crates</a>, <a href…
1391a href="#DepInfo-transitive_crate_outputs">transitive_crate_outputs</a>, <a href="#DepInfo-transit…
1392 …<a href="#DepInfo-transitive_noncrates">transitive_noncrates</a>, <a href="#DepInfo-transitive_pro…
1395 A provider containing information about a Crate's dependencies.
1401 | :------------- | :------------- |
1402 | <a id="DepInfo-dep_env"></a>dep_env | File: File with environment variables direct dependencies …
1403 | <a id="DepInfo-direct_crates"></a>direct_crates | depset[AliasableDepInfo] |
1404 | <a id="DepInfo-link_search_path_files"></a>link_search_path_files | depset[File]: All transitive…
1405 | <a id="DepInfo-transitive_build_infos"></a>transitive_build_infos | depset[BuildInfo] |
1406 | <a id="DepInfo-transitive_crate_outputs"></a>transitive_crate_outputs | depset[File]: All transi…
1407 | <a id="DepInfo-transitive_crates"></a>transitive_crates | depset[CrateInfo] |
1408 | <a id="DepInfo-transitive_data"></a>transitive_data | depset[File]: Data of all transitive non-m…
1409 | <a id="DepInfo-transitive_metadata_outputs"></a>transitive_metadata_outputs | depset[File]: All …
1410 | <a id="DepInfo-transitive_noncrates"></a>transitive_noncrates | depset[LinkerInput]: All transit…
1411 | <a id="DepInfo-transitive_proc_macro_data"></a>transitive_proc_macro_data | depset[File]: Data o…
1414 <a id="RustWasmBindgenInfo"></a>
1419 …BindgenInfo(<a href="#RustWasmBindgenInfo-js">js</a>, <a href="#RustWasmBindgenInfo-ts">ts</a>, <a
1422 Info about wasm-bindgen outputs.
1428 | :------------- | :------------- |
1429 | <a id="RustWasmBindgenInfo-js"></a>js | Depset[File]: The Javascript files produced by `wasm-bin…
1430 | <a id="RustWasmBindgenInfo-ts"></a>ts | Depset[File]: The Typescript files produced by `wasm-bin…
1431 | <a id="RustWasmBindgenInfo-wasm"></a>wasm | File: The `.wasm` file generated by `wasm-bindgen`. …
1434 <a id="StdLibInfo"></a>
1439a href="#StdLibInfo-alloc_files">alloc_files</a>, <a href="#StdLibInfo-between_alloc_and_core_file…
1440a href="#StdLibInfo-dot_a_files">dot_a_files</a>, <a href="#StdLibInfo-memchr_files">memchr_files<…
1441 … <a href="#StdLibInfo-std_rlibs">std_rlibs</a>, <a href="#StdLibInfo-test_files">test_files</a>)
1444 A collection of files either found within the `rust-stdlib` artifact or generated based on existing…
1450 | :------------- | :------------- |
1451 | <a id="StdLibInfo-alloc_files"></a>alloc_files | List[File]: `.a` files related to the `alloc` m…
1452 | <a id="StdLibInfo-between_alloc_and_core_files"></a>between_alloc_and_core_files | List[File]: `…
1453 | <a id="StdLibInfo-between_core_and_std_files"></a>between_core_and_std_files | List[File]: `.a` …
1454 | <a id="StdLibInfo-core_files"></a>core_files | List[File]: `.a` files related to the `core` and …
1455 | <a id="StdLibInfo-dot_a_files"></a>dot_a_files | Depset[File]: Generated `.a` files |
1456 | <a id="StdLibInfo-memchr_files"></a>memchr_files | Depset[File]: `.a` files associated with the …
1457 | <a id="StdLibInfo-panic_files"></a>panic_files | Depset[File]: `.a` files associated with `panic…
1458 | <a id="StdLibInfo-self_contained_files"></a>self_contained_files | List[File]: All `.o` files fr…
1459 | <a id="StdLibInfo-srcs"></a>srcs | List[Target]: All targets from the original `srcs` attribute.…
1460 | <a id="StdLibInfo-std_dylib"></a>std_dylib | File: libstd.so file |
1461 | <a id="StdLibInfo-std_files"></a>std_files | Depset[File]: `.a` files associated with the `std` …
1462 | <a id="StdLibInfo-std_rlibs"></a>std_rlibs | List[File]: All `.rlib` files |
1463 | <a id="StdLibInfo-test_files"></a>test_files | Depset[File]: `.a` files associated with the `tes…
1466 <a id="cargo_build_script"></a>
1471a href="#cargo_build_script-name">name</a>, <a href="#cargo_build_script-edition">edition</a>, <a
1472a href="#cargo_build_script-link_deps">link_deps</a>, <a href="#cargo_build_script-proc_macro_deps…
1473a href="#cargo_build_script-rundir">rundir</a>, <a href="#cargo_build_script-rustc_env">rustc_env<…
1474 …<a href="#cargo_build_script-pkg_name">pkg_name</a>, <a href="#cargo_build_script-kwargs">kwargs</
1477 Compile and execute a rust build script to generate build attributes
1483 Suppose you have a crate with a cargo build script `build.rs`:
1514 # execpath/location will return an absolute path, instead of a relative
1539 | :------------- | :------------- | :------------- |
1540 … <a id="cargo_build_script-name"></a>name | The name for the underlying rule. This should be the …
1541 | <a id="cargo_build_script-edition"></a>edition | The rust edition to use for the internal binary…
1542 | <a id="cargo_build_script-crate_name"></a>crate_name | Crate name to use for build script. | …
1543 | <a id="cargo_build_script-crate_root"></a>crate_root | The file that will be passed to rustc to …
1544 | <a id="cargo_build_script-srcs"></a>srcs | Souce files of the crate to build. Passing source fil…
1545 | <a id="cargo_build_script-crate_features"></a>crate_features | A list of features to enable for …
1546 | <a id="cargo_build_script-version"></a>version | The semantic version (semver) of the crate. |…
1547 | <a id="cargo_build_script-deps"></a>deps | The build-dependencies of the crate. | `[]` |
1548 | <a id="cargo_build_script-link_deps"></a>link_deps | The subset of the (normal) dependencies of …
1549 | <a id="cargo_build_script-proc_macro_deps"></a>proc_macro_deps | List of rust_proc_macro targets…
1550 | <a id="cargo_build_script-build_script_env"></a>build_script_env | Environment variables for bui…
1551 | <a id="cargo_build_script-data"></a>data | Files needed by the build script. | `[]` |
1552 | <a id="cargo_build_script-compile_data"></a>compile_data | Files needed for the compilation of t…
1553 | <a id="cargo_build_script-tools"></a>tools | Tools (executables) needed by the build script. |…
1554 | <a id="cargo_build_script-links"></a>links | Name of the native library this crate links against…
1555 | <a id="cargo_build_script-rundir"></a>rundir | A directory to `cd` to before the cargo_build_scr…
1556 | <a id="cargo_build_script-rustc_env"></a>rustc_env | Environment variables to set in rustc when …
1557 | <a id="cargo_build_script-rustc_env_files"></a>rustc_env_files | Files containing additional env…
1558 | <a id="cargo_build_script-rustc_flags"></a>rustc_flags | List of compiler flags passed to `rustc…
1559 | <a id="cargo_build_script-visibility"></a>visibility | Visibility to apply to the generated buil…
1560 | <a id="cargo_build_script-tags"></a>tags | (list of str, optional): Tags to apply to the generat…
1561 | <a id="cargo_build_script-aliases"></a>aliases | Remap crates to a new name or moniker for linka…
1562 | <a id="cargo_build_script-pkg_name"></a>pkg_name | Override the package name used for the build …
1563 | <a id="cargo_build_script-kwargs"></a>kwargs | Forwards to the underlying `rust_binary` rule. An…
1566 <a id="cargo_env"></a>
1571 cargo_env(<a href="#cargo_env-env">env</a>)
1574 A helper for generating platform specific environment variables
1586 binary = "my-crate-binary",
1588 "x86_64-unknown-linux-gnu": cargo_env({
1593 "aarch64-unknown-linux-musl": cargo_env({
1605 | :------------- | :------------- | :------------- |
1606 | <a id="cargo_env-env"></a>env | A map of environment variables | none |
1610 str: A json encoded string of the environment variables
1613 <a id="rules_rust_dependencies"></a>
1625 <a id="rust_analyzer_toolchain_repository"></a>
1630a href="#rust_analyzer_toolchain_repository-name">name</a>, <a href="#rust_analyzer_toolchain_repo…
1631a href="#rust_analyzer_toolchain_repository-iso_date">iso_date</a>, <a href="#rust_analyzer_toolch…
1634 Assemble a remote rust_analyzer_toolchain target based on the given params.
1640 | :------------- | :------------- | :------------- |
1641 | <a id="rust_analyzer_toolchain_repository-name"></a>name | The name of the toolchain proxy repos…
1642 | <a id="rust_analyzer_toolchain_repository-version"></a>version | The version of the tool among "…
1643 | <a id="rust_analyzer_toolchain_repository-exec_compatible_with"></a>exec_compatible_with | A lis…
1644 | <a id="rust_analyzer_toolchain_repository-target_compatible_with"></a>target_compatible_with | A
1645 | <a id="rust_analyzer_toolchain_repository-iso_date"></a>iso_date | The date of the tool. | `N…
1646 | <a id="rust_analyzer_toolchain_repository-sha256s"></a>sha256s | A dict associating tool subdire…
1647a id="rust_analyzer_toolchain_repository-urls"></a>urls | A list of mirror urls containing the to…
1648 | <a id="rust_analyzer_toolchain_repository-auth"></a>auth | Auth object compatible with repositor…
1649 | <a id="rust_analyzer_toolchain_repository-netrc"></a>netrc | .netrc file to use for authenticati…
1650 | <a id="rust_analyzer_toolchain_repository-auth_patterns"></a>auth_patterns | Override mapping of…
1654 str: The name of a registerable rust_analyzer_toolchain.
1657 <a id="rust_bindgen_dependencies"></a>
1670 list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories
1674 <a id="rust_bindgen_library"></a>
1679a href="#rust_bindgen_library-name">name</a>, <a href="#rust_bindgen_library-header">header</a>, <
1680 …<a href="#rust_bindgen_library-wrap_static_fns">wrap_static_fns</a>, <a href="#rust_bindgen_librar…
1683 Generates a rust source file for `header`, and builds a rust_library.
1692 | :------------- | :------------- | :------------- |
1693 | <a id="rust_bindgen_library-name"></a>name | A unique name for this target. | none |
1694 | <a id="rust_bindgen_library-header"></a>header | The label of the .h file to generate bindings f…
1695 | <a id="rust_bindgen_library-cc_lib"></a>cc_lib | The label of the cc_library that contains the .…
1696 …<a id="rust_bindgen_library-bindgen_flags"></a>bindgen_flags | Flags to pass directly to the bind…
1697 | <a id="rust_bindgen_library-bindgen_features"></a>bindgen_features | The `features` attribute fo…
1698 | <a id="rust_bindgen_library-clang_flags"></a>clang_flags | Flags to pass directly to the clang e…
1699a id="rust_bindgen_library-wrap_static_fns"></a>wrap_static_fns | Whether to create a separate .c…
1700 | <a id="rust_bindgen_library-kwargs"></a>kwargs | Arguments to forward to the underlying `rust_li…
1703 <a id="rust_bindgen_register_toolchains"></a>
1708 rust_bindgen_register_toolchains(<a href="#rust_bindgen_register_toolchains-register_toolchains">re…
1713 [bg]: https://rust-lang.github.io/rust-bindgen/
1720 | :------------- | :------------- | :------------- |
1721 | <a id="rust_bindgen_register_toolchains-register_toolchains"></a>register_toolchains | Whether o…
1724 <a id="rust_prost_dependencies"></a>
1729 rust_prost_dependencies(<a href="#rust_prost_dependencies-bzlmod">bzlmod</a>)
1738 | :------------- | :------------- | :------------- |
1739 | <a id="rust_prost_dependencies-bzlmod"></a>bzlmod | Whether bzlmod is enabled. | `False` |
1743 list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories
1747 <a id="rust_prost_library"></a>
1752 rust_prost_library(<a href="#rust_prost_library-name">name</a>, <a href="#rust_prost_library-kwargs…
1755 A rule for generating a Rust library using Prost.
1761 | :------------- | :------------- | :------------- |
1762 | <a id="rust_prost_library-name"></a>name | The name of the target. | none |
1763 | <a id="rust_prost_library-kwargs"></a>kwargs | Additional keyword arguments for the underlying `…
1766 <a id="rust_prost_transitive_repositories"></a>
1780 <a id="rust_proto_protobuf_dependencies"></a>
1785 rust_proto_protobuf_dependencies(<a href="#rust_proto_protobuf_dependencies-bzlmod">bzlmod</a>)
1794 | :------------- | :------------- | :------------- |
1795 | <a id="rust_proto_protobuf_dependencies-bzlmod"></a>bzlmod | Whether this function is being call…
1799 A list of structs containing information about root module deps to report to bzlmod's extension_met…
1802 <a id="rust_proto_protobuf_register_toolchains"></a>
1807 …protobuf_register_toolchains(<a href="#rust_proto_protobuf_register_toolchains-register_toolchains…
1816 | :------------- | :------------- | :------------- |
1817 | <a id="rust_proto_protobuf_register_toolchains-register_toolchains"></a>register_toolchains | <p…
1820 <a id="rust_proto_protobuf_transitive_repositories"></a>
1834 <a id="rust_register_toolchains"></a>
1839a href="#rust_register_toolchains-dev_components">dev_components</a>, <a href="#rust_register_tool…
1840a href="#rust_register_toolchains-iso_date">iso_date</a>, <a href="#rust_register_toolchains-regis…
1841a href="#rust_register_toolchains-sha256s">sha256s</a>, <a href="#rust_register_toolchains-extra_t…
1842a href="#rust_register_toolchains-urls">urls</a>, <a href="#rust_register_toolchains-version">vers…
1845 Emits a default set of toolchains for Linux, MacOS, and Freebsd
1847 Skip this macro and call the `rust_repository_set` macros directly if you need a compiler for o…
1849 The `sha256s` attribute represents a dict associating tool subdirectories to sha256 hashes. As an e…
1852 …"rust-1.46.0-x86_64-unknown-linux-gnu": "e3b98bc3440fe92817881933f9564389eccb396f5f431f33d48b979fa…
1853 …"rustfmt-1.4.12-x86_64-unknown-linux-gnu": "1894e76913303d66bf40885a601462844eec15fca9e76a6d13c390…
1854 …"rust-std-1.46.0-x86_64-unknown-linux-gnu": "ac04aef80423f612c0079829b504902de27a6997214eb58ab0765…
1857 …his would match for `exec_triple = "x86_64-unknown-linux-gnu"`. If not specified, rules_rust pull…
1866 | :------------- | :------------- | :------------- |
1867 | <a id="rust_register_toolchains-dev_components"></a>dev_components | Whether to download the rus…
1868 | <a id="rust_register_toolchains-edition"></a>edition | The rust edition to be used by default (2…
1869a id="rust_register_toolchains-allocator_library"></a>allocator_library | Target that provides al…
1870 | <a id="rust_register_toolchains-global_allocator_library"></a>global_allocator_library | Target …
1871 | <a id="rust_register_toolchains-iso_date"></a>iso_date | **Deprecated**: Use `versions` instead.…
1872 | <a id="rust_register_toolchains-register_toolchains"></a>register_toolchains | If true, reposito…
1873 | <a id="rust_register_toolchains-rustfmt_version"></a>rustfmt_version | The version of rustfmt. I…
1874 | <a id="rust_register_toolchains-rust_analyzer_version"></a>rust_analyzer_version | The version o…
1875 | <a id="rust_register_toolchains-sha256s"></a>sha256s | A dict associating tool subdirectories to…
1876a id="rust_register_toolchains-extra_target_triples"></a>extra_target_triples | Additional rust-s…
1877 …<a id="rust_register_toolchains-extra_rustc_flags"></a>extra_rustc_flags | Dictionary of target t…
1878 | <a id="rust_register_toolchains-extra_exec_rustc_flags"></a>extra_exec_rustc_flags | Extra flags…
1879a id="rust_register_toolchains-urls"></a>urls | A list of mirror urls containing the tools from t…
1880 | <a id="rust_register_toolchains-version"></a>version | **Deprecated**: Use `versions` instead. …
1881a id="rust_register_toolchains-versions"></a>versions | A list of toolchain versions to download.…
1884 <a id="rust_repositories"></a>
1889 rust_repositories(<a href="#rust_repositories-kwargs">kwargs</a>)
1898 | :------------- | :------------- | :------------- |
1899 | <a id="rust_repositories-kwargs"></a>kwargs | Keyword arguments for the `rust_register_toolchain…
1902 <a id="rust_repository_set"></a>
1907a href="#rust_repository_set-name">name</a>, <a href="#rust_repository_set-exec_triple">exec_tripl…
1908a href="#rust_repository_set-global_allocator_library">global_allocator_library</a>, <a href="#rus…
1909a href="#rust_repository_set-edition">edition</a>, <a href="#rust_repository_set-dev_components">d…
1910a href="#rust_repository_set-sha256s">sha256s</a>, <a href="#rust_repository_set-urls">urls</a>, <
1911a href="#rust_repository_set-exec_compatible_with">exec_compatible_with</a>, <a href="#rust_reposi…
1914 Assembles a remote repository for the given toolchain params, produces a proxy repository to co…
1920 | :------------- | :------------- | :------------- |
1921 | <a id="rust_repository_set-name"></a>name | The name of the generated repository | none |
1922 | <a id="rust_repository_set-exec_triple"></a>exec_triple | The Rust-style target that this compil…
1923 | <a id="rust_repository_set-target_settings"></a>target_settings | A list of config_settings that…
1924 | <a id="rust_repository_set-version"></a>version | The version of the tool among "nightly", "beta…
1925a id="rust_repository_set-versions"></a>versions | A list of toolchain versions to download. This…
1926a id="rust_repository_set-allocator_library"></a>allocator_library | Target that provides allocat…
1927 | <a id="rust_repository_set-global_allocator_library"></a>global_allocator_library | Target that …
1928a id="rust_repository_set-extra_target_triples"></a>extra_target_triples | Additional rust-style …
1929 | <a id="rust_repository_set-iso_date"></a>iso_date | The date of the tool. | `None` |
1930 | <a id="rust_repository_set-rustfmt_version"></a>rustfmt_version | The version of rustfmt to be a…
1931 | <a id="rust_repository_set-edition"></a>edition | The rust edition to be used by default (2015, …
1932 | <a id="rust_repository_set-dev_components"></a>dev_components | Whether to download the rustc-de…
1933 | <a id="rust_repository_set-extra_rustc_flags"></a>extra_rustc_flags | Dictionary of target tripl…
1934 | <a id="rust_repository_set-extra_exec_rustc_flags"></a>extra_exec_rustc_flags | Extra flags to p…
1935 | <a id="rust_repository_set-opt_level"></a>opt_level | Dictionary of target triples to optimiztio…
1936 | <a id="rust_repository_set-sha256s"></a>sha256s | A dict associating tool subdirectories to sha2…
1937a id="rust_repository_set-urls"></a>urls | A list of mirror urls containing the tools from the Ru…
1938 | <a id="rust_repository_set-auth"></a>auth | Auth object compatible with repository_ctx.download …
1939 | <a id="rust_repository_set-netrc"></a>netrc | .netrc file to use for authentication; mirrors the…
1940 | <a id="rust_repository_set-auth_patterns"></a>auth_patterns | Override mapping of hostnames to a…
1941 | <a id="rust_repository_set-register_toolchain"></a>register_toolchain | If True, the generated `…
1942 | <a id="rust_repository_set-exec_compatible_with"></a>exec_compatible_with | A list of constraint…
1943 | <a id="rust_repository_set-default_target_compatible_with"></a>default_target_compatible_with |
1946 <a id="rust_test_suite"></a>
1951a href="#rust_test_suite-name">name</a>, <a href="#rust_test_suite-srcs">srcs</a>, <a href="#rust_…
1954 A rule for creating a test suite for a set of `rust_test` targets.
1976 and a [test_suite][ts] which encapsulates all tests.
1999 [it]: https://doc.rust-lang.org/rust-by-example/testing/integration_testing.html
2007 | :------------- | :------------- | :------------- |
2008 | <a id="rust_test_suite-name"></a>name | The name of the `test_suite`. | none |
2009 | <a id="rust_test_suite-srcs"></a>srcs | All test sources, typically `glob(["tests/**/*.rs"])`. …
2010 | <a id="rust_test_suite-shared_srcs"></a>shared_srcs | Optional argument for sources shared among…
2011 | <a id="rust_test_suite-kwargs"></a>kwargs | Additional keyword arguments for the underyling [rus…
2014 <a id="rust_toolchain_repository"></a>
2019a href="#rust_toolchain_repository-name">name</a>, <a href="#rust_toolchain_repository-version">ve…
2020a href="#rust_toolchain_repository-target_compatible_with">target_compatible_with</a>, <a href="#r…
2021a href="#rust_toolchain_repository-global_allocator_library">global_allocator_library</a>, <a href…
2022a href="#rust_toolchain_repository-dev_components">dev_components</a>, <a href="#rust_toolchain_re…
2023a href="#rust_toolchain_repository-sha256s">sha256s</a>, <a href="#rust_toolchain_repository-urls"…
2026 Assembles a remote repository for the given toolchain params, produces a proxy repository to co…
2032 | :------------- | :------------- | :------------- |
2033 | <a id="rust_toolchain_repository-name"></a>name | The name of the generated repository | none…
2034 | <a id="rust_toolchain_repository-version"></a>version | The version of the tool among "nightly",…
2035 | <a id="rust_toolchain_repository-exec_triple"></a>exec_triple | The Rust-style target that this …
2036 | <a id="rust_toolchain_repository-target_triple"></a>target_triple | The Rust-style target to bui…
2037 | <a id="rust_toolchain_repository-exec_compatible_with"></a>exec_compatible_with | A list of cons…
2038 | <a id="rust_toolchain_repository-target_compatible_with"></a>target_compatible_with | A list of …
2039 | <a id="rust_toolchain_repository-target_settings"></a>target_settings | A list of config_setting…
2040 | <a id="rust_toolchain_repository-channel"></a>channel | The channel of the Rust toolchain. | …
2041a id="rust_toolchain_repository-allocator_library"></a>allocator_library | Target that provides a…
2042 | <a id="rust_toolchain_repository-global_allocator_library"></a>global_allocator_library | Target…
2043 | <a id="rust_toolchain_repository-iso_date"></a>iso_date | The date of the tool. | `None` |
2044 | <a id="rust_toolchain_repository-rustfmt_version"></a>rustfmt_version | The version of rustfmt t…
2045 | <a id="rust_toolchain_repository-edition"></a>edition | The rust edition to be used by default (…
2046 | <a id="rust_toolchain_repository-dev_components"></a>dev_components | Whether to download the ru…
2047 | <a id="rust_toolchain_repository-extra_rustc_flags"></a>extra_rustc_flags | Extra flags to pass …
2048 | <a id="rust_toolchain_repository-extra_exec_rustc_flags"></a>extra_exec_rustc_flags | Extra flag…
2049 | <a id="rust_toolchain_repository-opt_level"></a>opt_level | Optimization level config for this t…
2050 | <a id="rust_toolchain_repository-sha256s"></a>sha256s | A dict associating tool subdirectories t…
2051a id="rust_toolchain_repository-urls"></a>urls | A list of mirror urls containing the tools from …
2052 | <a id="rust_toolchain_repository-auth"></a>auth | Auth object compatible with repository_ctx.dow…
2053 | <a id="rust_toolchain_repository-netrc"></a>netrc | .netrc file to use for authentication; mirro…
2054 | <a id="rust_toolchain_repository-auth_patterns"></a>auth_patterns | A list of patterns to match …
2061 <a id="rust_wasm_bindgen_dependencies"></a>
2069 Declare dependencies needed for the `rules_rust` [wasm-bindgen][wb] rules.
2071 [wb]: https://github.com/rustwasm/wasm-bindgen
2077 list[struct(repo=str, is_dev_dep=bool)]: A list of the repositories
2081 <a id="rust_wasm_bindgen_register_toolchains"></a>
2086 …m_bindgen_register_toolchains(<a href="#rust_wasm_bindgen_register_toolchains-register_toolchains"…
2089 Registers the default toolchains for the `rules_rust` [wasm-bindgen][wb] rules.
2091 [wb]: https://github.com/rustwasm/wasm-bindgen
2098 | :------------- | :------------- | :------------- |
2099 | <a id="rust_wasm_bindgen_register_toolchains-register_toolchains"></a>register_toolchains | Whet…
2102 <a id="rust_analyzer_aspect"></a>
2107 rust_analyzer_aspect(<a href="#rust_analyzer_aspect-name">name</a>)
2110 Annotates rust rules with RustAnalyzerInfo later used to build a rust-project.json
2116 | :------------- | :------------- |
2128 | :------------- | :------------- | :------------- | :------------- | :------------- |
2129 | <a id="rust_analyzer_aspect-name"></a>name | A unique name for this target. | <a href="https:/…
2132 <a id="rust_clippy_aspect"></a>
2137 rust_clippy_aspect(<a href="#rust_clippy_aspect-name">name</a>)
2164 $ bazel build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect --output_groups…
2175 | :------------- | :------------- | :------------- | :------------- | :------------- |
2176 | <a id="rust_clippy_aspect-name"></a>name | A unique name for this target. | <a href="https://b…
2179 <a id="rustfmt_aspect"></a>
2184 rustfmt_aspect(<a href="#rustfmt_aspect-name">name</a>)
2187 This aspect is used to gather information about a crate for use in rustfmt and perform rustfmt chec…
2191 - `rustfmt_checks`: Executes `rustfmt --check` on the specified target.
2196 [cs]: https://rust-lang.github.io/rustfmt/
2199 users may tag a target with `no-rustfmt` or `no-format` to have it skipped. Additionally,
2210 | :------------- | :------------- | :------------- | :------------- | :------------- |
2211 | <a id="rustfmt_aspect-name"></a>name | A unique name for this target. | <a href="https://bazel…
2214 <a id="cargo_bootstrap_repository"></a>
2219a href="#cargo_bootstrap_repository-name">name</a>, <a href="#cargo_bootstrap_repository-srcs">src…
2220a href="#cargo_bootstrap_repository-env_label">env_label</a>, <a href="#cargo_bootstrap_repository
2221a href="#cargo_bootstrap_repository-rust_toolchain_rustc_template">rust_toolchain_rustc_template</
2224 A rule for bootstrapping a Rust binary using [Cargo](https://doc.rust-lang.org/cargo/)
2230 | :------------- | :------------- | :------------- | :------------- | :------------- |
2231a id="cargo_bootstrap_repository-name"></a>name | A unique name for this repository. | <a href=…
2232a id="cargo_bootstrap_repository-srcs"></a>srcs | Souce files of the crate to build. Passing sour…
2233 | <a id="cargo_bootstrap_repository-binary"></a>binary | The binary to build (the `--bin` paramete…
2234 | <a id="cargo_bootstrap_repository-build_mode"></a>build_mode | The build mode the binary should …
2235a id="cargo_bootstrap_repository-cargo_lockfile"></a>cargo_lockfile | The lockfile of the crate_u…
2236a id="cargo_bootstrap_repository-cargo_toml"></a>cargo_toml | The path of the crate_universe reso…
2237a id="cargo_bootstrap_repository-env"></a>env | A mapping of platform triple to a set of environm…
2238a id="cargo_bootstrap_repository-env_label"></a>env_label | A mapping of platform triple to a set…
2239a id="cargo_bootstrap_repository-repo_mapping"></a>repo_mapping | In `WORKSPACE` context only: a
2240a id="cargo_bootstrap_repository-rust_toolchain_cargo_template"></a>rust_toolchain_cargo_template …
2241a id="cargo_bootstrap_repository-rust_toolchain_rustc_template"></a>rust_toolchain_rustc_template …
2242 | <a id="cargo_bootstrap_repository-timeout"></a>timeout | Maximum duration of the Cargo build com…
2243a id="cargo_bootstrap_repository-version"></a>version | The version of Rust the currently registe…
2246 <a id="rust_toolchain_repository_proxy"></a>
2251a href="#rust_toolchain_repository_proxy-name">name</a>, <a href="#rust_toolchain_repository_proxy
2252a href="#rust_toolchain_repository_proxy-target_settings">target_settings</a>, <a href="#rust_tool…
2255 Generates a toolchain-bearing repository that declares the toolchains from some other rust_toolchai…
2261 | :------------- | :------------- | :------------- | :------------- | :------------- |
2262a id="rust_toolchain_repository_proxy-name"></a>name | A unique name for this repository. | <a
2263 | <a id="rust_toolchain_repository_proxy-exec_compatible_with"></a>exec_compatible_with | A list o…
2264a id="rust_toolchain_repository_proxy-repo_mapping"></a>repo_mapping | In `WORKSPACE` context onl…
2265 | <a id="rust_toolchain_repository_proxy-target_compatible_with"></a>target_compatible_with | A li…
2266 | <a id="rust_toolchain_repository_proxy-target_settings"></a>target_settings | A list of config_s…
2267 | <a id="rust_toolchain_repository_proxy-toolchain"></a>toolchain | The name of the toolchain impl…
2268 | <a id="rust_toolchain_repository_proxy-toolchain_type"></a>toolchain_type | The toolchain type o…
2271 <a id="rust_toolchain_tools_repository"></a>
2276a href="#rust_toolchain_tools_repository-name">name</a>, <a href="#rust_toolchain_tools_repository
2277a href="#rust_toolchain_tools_repository-edition">edition</a>, <a href="#rust_toolchain_tools_repo…
2278a href="#rust_toolchain_tools_repository-global_allocator_library">global_allocator_library</a>, <
2279a href="#rust_toolchain_tools_repository-rustfmt_version">rustfmt_version</a>, <a href="#rust_tool…
2282 Composes a single workspace containing the toolchain components for compiling on a given platform t…
2284 A given instance of this rule should be accompanied by a toolchain_repository_proxy invocation to d…
2290 | :------------- | :------------- | :------------- | :------------- | :------------- |
2291a id="rust_toolchain_tools_repository-name"></a>name | A unique name for this repository. | <a
2292a id="rust_toolchain_tools_repository-allocator_library"></a>allocator_library | Target that prov…
2293a id="rust_toolchain_tools_repository-auth"></a>auth | Auth object compatible with repository_ctx…
2294 | <a id="rust_toolchain_tools_repository-auth_patterns"></a>auth_patterns | A list of patterns to …
2295 | <a id="rust_toolchain_tools_repository-dev_components"></a>dev_components | Whether to download …
2296 | <a id="rust_toolchain_tools_repository-edition"></a>edition | The rust edition to be used by def…
2297 | <a id="rust_toolchain_tools_repository-exec_triple"></a>exec_triple | The Rust-style target that…
2298 | <a id="rust_toolchain_tools_repository-extra_exec_rustc_flags"></a>extra_exec_rustc_flags | Extr…
2299 | <a id="rust_toolchain_tools_repository-extra_rustc_flags"></a>extra_rustc_flags | Extra flags to…
2300 | <a id="rust_toolchain_tools_repository-global_allocator_library"></a>global_allocator_library | …
2301 | <a id="rust_toolchain_tools_repository-iso_date"></a>iso_date | The date of the tool (or None, i…
2302 | <a id="rust_toolchain_tools_repository-netrc"></a>netrc | .netrc file to use for authentication;…
2303a id="rust_toolchain_tools_repository-opt_level"></a>opt_level | Rustc optimization levels. For m…
2304a id="rust_toolchain_tools_repository-repo_mapping"></a>repo_mapping | In `WORKSPACE` context onl…
2305 | <a id="rust_toolchain_tools_repository-rustfmt_version"></a>rustfmt_version | The version of the…
2306a id="rust_toolchain_tools_repository-sha256s"></a>sha256s | A dict associating tool subdirectori…
2307 | <a id="rust_toolchain_tools_repository-target_triple"></a>target_triple | The Rust-style target …
2308a id="rust_toolchain_tools_repository-urls"></a>urls | A list of mirror urls containing the tools…
2309 | <a id="rust_toolchain_tools_repository-version"></a>version | The version of the tool among "nig…