Fix doc links pointing to private items (#6944)

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.
This commit is contained in:
Marek 2023-06-14 21:09:10 +02:00 committed by GitHub
parent 4d1ff3b363
commit c4c29eb466
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -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,
@ -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",
]

View File

@ -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