From cf1eb73046630b075deb824cc34616432dd5a419 Mon Sep 17 00:00:00 2001 From: Guillaume Thiolliere Date: Thu, 16 Dec 2021 04:28:18 +0900 Subject: [PATCH] Deny warning when building doc (#10387) * deny warning * add new job * fix doc * fmt --- substrate/.gitlab-ci.yml | 13 ++++++++++++- substrate/primitives/beefy/src/commitment.rs | 6 +++--- .../utils/frame/remote-externalities/src/lib.rs | 8 ++++---- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/substrate/.gitlab-ci.yml b/substrate/.gitlab-ci.yml index 3f830c7e8e..589adeec52 100644 --- a/substrate/.gitlab-ci.yml +++ b/substrate/.gitlab-ci.yml @@ -650,6 +650,18 @@ build-macos-subkey: tags: - osx +check-rustdoc: + stage: test + <<: *docker-env + <<: *test-refs + variables: + <<: *default-vars + SKIP_WASM_BUILD: 1 + RUSTDOCFLAGS: "-Dwarnings" + script: + - time cargo +nightly doc --workspace --all-features --verbose --no-deps + - sccache -s + build-rustdoc: stage: build <<: *docker-env @@ -665,7 +677,6 @@ build-rustdoc: paths: - ./crate-docs/ script: - # FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` - time cargo +nightly doc --workspace --all-features --verbose - rm -f ./target/doc/.lock - mv ./target/doc ./crate-docs diff --git a/substrate/primitives/beefy/src/commitment.rs b/substrate/primitives/beefy/src/commitment.rs index 6553f6ffc9..ec1ceeded8 100644 --- a/substrate/primitives/beefy/src/commitment.rs +++ b/substrate/primitives/beefy/src/commitment.rs @@ -27,9 +27,9 @@ pub type BeefyPayloadId = [u8; 2]; pub mod known_payload_ids { use crate::BeefyPayloadId; - /// A [`Payload`] identifier for Merkle Mountain Range root hash. + /// A [`Payload`](super::Payload) identifier for Merkle Mountain Range root hash. /// - /// Encoded value should contain a [`beefy_primitives::MmrRootHash`] type (i.e. 32-bytes hash). + /// Encoded value should contain a [`crate::MmrRootHash`] type (i.e. 32-bytes hash). pub const MMR_ROOT_ID: BeefyPayloadId = *b"mh"; } @@ -137,7 +137,7 @@ where /// /// Note that SCALE-encoding of the structure is optimized for size efficiency over the wire, /// please take a look at custom [`Encode`] and [`Decode`] implementations and -/// [`CompactSignedCommitment`] struct. +/// `CompactSignedCommitment` struct. #[derive(Clone, Debug, PartialEq, Eq)] pub struct SignedCommitment { /// The commitment signatures are collected for. diff --git a/substrate/utils/frame/remote-externalities/src/lib.rs b/substrate/utils/frame/remote-externalities/src/lib.rs index e8453ddcd8..1b61f07114 100644 --- a/substrate/utils/frame/remote-externalities/src/lib.rs +++ b/substrate/utils/frame/remote-externalities/src/lib.rs @@ -738,7 +738,7 @@ impl Builder { self } - /// Just a utility wrapper of [`inject_hashed_prefix`] that injects + /// Just a utility wrapper of [`Self::inject_hashed_prefix`] that injects /// [`DEFAULT_CHILD_STORAGE_KEY_PREFIX`] as a prefix. /// /// If set, this will guarantee that the child-tree data of ALL pallets will be downloaded. @@ -747,9 +747,9 @@ impl Builder { /// /// Otherwise, the only other way to make sure a child-tree is manually included is to inject /// its root (`DEFAULT_CHILD_STORAGE_KEY_PREFIX`, plus some other postfix) into - /// [`inject_hashed_key`]. Unfortunately, there's no federated way of managing child tree roots - /// as of now and each pallet does its own thing. Therefore, it is not possible for this library - /// to automatically include child trees of pallet X, when its top keys are included. + /// [`Self::inject_hashed_key`]. Unfortunately, there's no federated way of managing child tree + /// roots as of now and each pallet does its own thing. Therefore, it is not possible for this + /// library to automatically include child trees of pallet X, when its top keys are included. pub fn inject_default_child_tree_prefix(self) -> Self { self.inject_hashed_prefix(DEFAULT_CHILD_STORAGE_KEY_PREFIX) }