Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose the existing rustdoc action builder, dependency conversion helper and
LintsInfoprovider through public load paths so custom doctest rules can reuse compiler setup without loading private modules.The public contract documents required rule attributes, toolchains, the C++ fragment, every returned action field, mutation of caller-supplied Args, and the distinction between build-time and runfiles-based invocations. The action builder now creates a fresh Args object when flags are omitted, so optional lint handling works with its default argument. Provider identities are unchanged.
Build-time invocations pass rustdoc as a File so Bazel can rewrite its executable path when path mapping is enabled. A custom rule using only public loads compiles and executes a native doctest with a normal dependency, a procedural macro and lint configuration. It checks dependency-provider conversion and the identity of the exported lint provider. This is a low-level API proposal; the caller still declares outputs and supplies any cross-platform test runner.
Fixes #4301.
Validation:
bazel test //test/unit/public_rustdoc:public_rustdoc_test //test/unit/lint_flags:all(4 tests passed), also with--experimental_output_paths=strip --config=clippy --config=rustfmt(4 tests passed). The path-mapping case failed before the fix. Formatting and whitespace checks passed.