Skip to content

Docs: rustdoc builds the formats and loader crates without warnings - #272

Closed
SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next11
Closed

SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next11

Conversation

@SkippySteve

Copy link
Copy Markdown

cargo doc --no-deps warns twice on main, in crates that document on any host:

warning: public documentation for `texture` links to private item `MICRO`
  --> crates/victory-formats/src/texture.rs:16:19
warning: `prepare` is both a function and a module
 --> crates/victory-loader/src/lib.rs:7:10
  • texture.rs: MICRO is a private table, so the public module page can't link to it. It stays in code font, without the link.
  • loader lib.rs: step 1 of the overview refers to the function, so the link is now [`prepare()`]. rustdoc resolves it to the function and no longer has to choose between the function and the prepare module.

The change is two comment lines. No code changes.

Testing (Linux)

  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps -p victory-core -p victory-pe -p victory-loader -p victory-formats -p victory-pipeline -p victory-game -p victory-shader passes. On main it fails on the two warnings above.
  • cargo clippy -p victory-formats -p victory-loader --all-targets -- -D warnings is clean.
  • cargo test -p victory-formats: 20 passed, 3 ignored.
  • cargo test -p victory-loader: the three prepare::tests that parse the test's own binary fail on Linux, both here and on main ("Unknown file magic", because that binary is ELF). This PR doesn't touch them.

cargo doc --no-deps warns twice on main for crates that document on any
host:

    warning: public documentation for `texture` links to private item `MICRO`
      --> crates/victory-formats/src/texture.rs:16:19
    warning: `prepare` is both a function and a module
     --> crates/victory-loader/src/lib.rs:7:10

MICRO is a private table, so the public page cannot link to it; it stays
named in code font. In the loader's overview, step 1 means the function,
so the link says prepare() and rustdoc resolves it there instead of
guessing between it and the module.

With both, RUSTDOCFLAGS="-D warnings" cargo doc --no-deps passes for
victory-core, -pe, -loader, -formats, -pipeline, -game and -shader.
Comments only; no code changes.
@SkippySteve

Copy link
Copy Markdown
Author

Superseded by #315, which now includes this rustdoc fix (same texture.rs).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant