Skip to content

Commit

Permalink
Fix doc links pointing to private items (ZcashFoundation#6944)
Browse files Browse the repository at this point in the history
Our documentation for some public items contains links to private items.
These links resolve fine because we use the `--document-private-flags`,
but still generate warnings during the compilation of the docs.

This commit (hopefully) correctly suppresses the warnings, and updates
CI.
  • Loading branch information
upbqdn authored Jun 14, 2023
1 parent 4d1ff3b commit c4c29eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ rustflags = [
# Documentation
"-Wmissing_docs",

# These rustdoc -A and -W settings must be the same as the RUSTDOCFLAGS in:
# https://github.com/ZcashFoundation/zebra/blob/main/.github/workflows/lint.yml#L152

# Links in public docs can point to private items.
"-Arustdoc::private_intra_doc_links",

# TODOs:
# `cargo fix` might help do these fixes,
# or add a config.toml to sub-directories which should allow these lints,
Expand All @@ -82,3 +76,12 @@ rustflags = [
# fix hidden lifetime parameters
#"-Wrust_2018_idioms",
]

[build]
rustdocflags = [
# The -A and -W settings must be the same as the `RUSTDOCFLAGS` in:
# https://github.com/ZcashFoundation/zebra/blob/main/.github/workflows/lint.yml#L151

# Links in public docs can point to private items.
"-Arustdoc::private_intra_doc_links",
]
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ jobs:
# cargo doc doesn't support '-- -D warnings', so we have to add it here
# https://github.com/rust-lang/cargo/issues/8424#issuecomment-774662296
#
# These -A and -W settings must be the same as the rustdoc settings in:
# https://github.com/ZcashFoundation/zebra/blob/main/.cargo/config.toml#L53
# The -A and -W settings must be the same as the `rustdocflags` in:
# https://github.com/ZcashFoundation/zebra/blob/main/.cargo/config.toml#L87
env:
RUSTDOCFLAGS: -D warnings -A rustdoc::private_intra_doc_links

Expand Down

0 comments on commit c4c29eb

Please sign in to comment.