feat: add `rustc_flags` attr to `rust_doc` rule (#1458)

**Context**
When building [rustdocs](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) it is very useful to pass `-Dwarnings`. This allows you to easily assert things like [intra-doc-links](https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html) aren't broken. As far as I can tell, passing flags to `rustdoc` isn't possible today. 

**Solution**
Add the `rustc_flags` attr to the `rust_doc` rule. `rustc_flags` is already parsed in [`construct_arguments(...)`](https://github.com/bazelbuild/rules_rust/blob/main/rust/private/rustc.bzl#L601) which `rust_doc` calls into.
3 files changed
tree: 53d749252c1a17cd3693ebc3984fa9bc2a4dffdf
  1. .bazelci/
  2. .github/
  3. bindgen/
  4. cargo/
  5. crate_universe/
  6. distro/
  7. docs/
  8. examples/
  9. proto/
  10. rust/
  11. test/
  12. tools/
  13. util/
  14. wasm_bindgen/
  15. .bazelignore
  16. .bazelrc
  17. .clang-format
  18. .gitignore
  19. ARCHITECTURE.md
  20. AUTHORS
  21. BUILD.bazel
  22. CODEOWNERS
  23. COMPATIBILITY.md
  24. CONTRIBUTING.md
  25. CONTRIBUTORS
  26. LICENSE.txt
  27. README.md
  28. version.bzl
  29. WORKSPACE.bazel
  30. workspace.bzl
README.md

Rust Rules

  • Postsubmit Build status

Overview

This repository provides rules for building Rust projects with Bazel.

Community

General discussions and announcements take place in the GitHub Discussions, but there are additional places where community members gather to discuss rules_rust.

Documentation

Please refer to the full documentation.