Skip to content

Remove unsupported RUSTDOC_FLAGS warning from Cargo documentation tests #625

Description

@coderabbitai

Summary

Remove the Cargo warning emitted during documentation tests:

warning: ignoring environment variable `RUSTDOC_FLAGS`

Rationale

Makefile defines and exports RUSTDOC_FLAGS for repository-level configuration. Cargo recognizes RUSTDOCFLAGS, without an underscore between DOC and FLAGS. The doctest target runs cargo test --workspace --doc --all-features and inherits the unsupported RUSTDOC_FLAGS variable. Cargo emits the warning in the Windows CI test job.

The repository treats warnings as errors for quality gates. Remove this warning without weakening Rustdoc or compiler warning denial.

Required changes

  • Update the Makefile environment-variable contract for the doctest target.
  • Ensure Cargo documentation tests receive the intended Rustdoc flags through Cargo's supported RUSTDOCFLAGS environment variable, or prevent the unsupported RUSTDOC_FLAGS variable from reaching Cargo when it is not required.
  • Preserve -D warnings for the existing documentation and lint targets.
  • Preserve caller overrides where the current Makefile contract permits them.
  • Add or update focused Makefile contract coverage for the documentation-test environment contract.

Affected areas

  • Makefile, including RUSTDOC_FLAGS, doctest, and Rustdoc-related targets.
  • Makefile contract tests under tests/.

Acceptance criteria

  • make SHELL=bash doctest does not emit warning: ignoring environment variable \RUSTDOC_FLAGS`` on Windows.
  • Documentation tests retain the intended Rustdoc configuration and warning-denial policy.
  • Existing lint-clippy and documentation-coverage Rustdoc invocations retain their required flags.
  • A focused automated contract test prevents the unsupported variable from being passed to Cargo documentation tests.
  • Run make check-fmt, make lint, and make test.

Backlinks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglowBacklog work, hygiene, or technical debt planned opportunistically, without a strict deadline.testingTest coverage, test infrastructure, and verification tooling work.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions