From c4c29eb4665aa2213c61a73a7b8d7e438fc1c1dc Mon Sep 17 00:00:00 2001 From: Marek Date: Wed, 14 Jun 2023 21:09:10 +0200 Subject: [PATCH] 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. --- .cargo/config.toml | 15 +++++++++------ .github/workflows/lint.yml | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5b0f95da173..6be194a0c74 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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", +] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ac3be34d7c3..a8ec87324a5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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