mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
506642744c
# Objective Fixes #3566 ## Solution - [x] Fix broken links in private docs. - [x] Add the `--document-private-items` flag to the CI. ## Note The following was said by @killercup in #3566: > I don't have time to confirm this but I assume that linking to private items throws an error/warning when just running cargo doc, and --document-private-item might actually hide that warning. So to test this, you'd have to run it twice. I tested this and this is thankfully not the case. If you are linking to a private item you will get a warning no matter if you run `cargo doc` or `cargo doc --document-private-items`. ### Example I added `struct Test;` to `bevy_core/src/name.rs` and linked to it inside of a doc comment using ``[`Test`]``. After that I ran `cargo doc -p bevy_core --document-private-items` using `RUSTDOCFLAGS="-D warnings"` and got the following output (note the last sentence): ```rust error: public documentation for `Name` links to private item `Test` --> crates/bevy_core/src/name.rs:11:82 | 11 | /// Component used to identify an entity. Stores a hash for faster comparisons [`Test`] | ^^^^ this item is private | = note: `-D rustdoc::private-intra-doc-links` implied by `-D warnings` = note: this link resolves only because you passed `--document-private-items`, but will break without ``` |
||
---|---|---|
.. | ||
contributing | ||
example-run | ||
ISSUE_TEMPLATE | ||
linters | ||
workflows | ||
bors.toml | ||
dependabot.yml | ||
FUNDING.yml | ||
label-config.yml | ||
pull_request_template.md |