Add testing of doc links in test.sh
authorMatt Corallo <git@bluematt.me>
Fri, 9 Feb 2024 23:28:27 +0000 (23:28 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 9 Feb 2024 23:28:27 +0000 (23:28 +0000)
src/lib.rs
src/rr.rs
src/validation.rs
test.sh

index 0cabe0177671153f0cc8ce4b9ca03c8e912ba46f..b36f05483bd0545f57988ad56a5516b59078601b 100644 (file)
@@ -26,6 +26,8 @@
 //!    proofs.
 
 #![deny(missing_docs)]
+#![deny(rustdoc::broken_intra_doc_links)]
+#![deny(rustdoc::private_intra_doc_links)]
 
 #![cfg_attr(not(feature = "std"), no_std)]
 extern crate alloc;
index d3a6dd466927f235fb11165e5012276637810871..9886e3a71ceff967da990ffc8fa882d806650241 100644 (file)
--- a/src/rr.rs
+++ b/src/rr.rs
@@ -300,7 +300,7 @@ pub struct CName {
        pub name: Name,
        /// The canonical name.
        ///
-       /// A resolver should use this name when looking up any further records for [`Self::name`].
+       /// A resolver should use this name when looking up any further records for [`self.name`].
        pub canonical_name: Name,
 }
 impl StaticRecord for CName {
@@ -385,7 +385,7 @@ impl DnsKey {
 
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
 /// A Delegation Signer resource record which indicates that some alternative [`DnsKey`] can sign
-/// for records in the zone which matches [`DS::name`].
+/// for records in the zone which matches [`self.name`].
 pub struct DS {
        /// The name this record is at.
        ///
@@ -447,7 +447,7 @@ pub struct RRSig {
        pub name: Name,
        /// The resource record type which this [`RRSig`] is signing.
        ///
-       /// All resources records of this type at the same name as [`Self::name`] must be signed by
+       /// All resources records of this type at the same name as [`self.name`] must be signed by
        /// this [`RRSig`].
        pub ty: u16,
        /// The algorithm which is being used to sign.
@@ -456,7 +456,7 @@ pub struct RRSig {
        pub alg: u8,
        /// The number of labels in the name of the records that this signature is signing.
        ///
-       /// If this is less than the number of labels in [`Self::name`], this signature is covering a
+       /// If this is less than the number of labels in [`self.name`], this signature is covering a
        /// wildcard entry.
        pub labels: u8,
        /// The TTL of the records which this [`RRSig`] is signing.
@@ -471,7 +471,11 @@ pub struct RRSig {
        pub key_tag: u16,
        /// The [`DnsKey::name`] in the [`DnsKey`] which created this signature.
        ///
-       /// This must be a parent of the [`Self::name`].
+       /// This must be a parent of [`self.name`].
+       ///
+       /// [`DnsKey::name`]: Record::name
+       // We'd like to just link to the `DnsKey` member variable called `name`, but there doesn't
+       // appear to be a way to actually do that, so instead we have to link to the trait method.
        pub key_name: Name,
        /// The signature itself.
        pub signature: Vec<u8>,
@@ -578,7 +582,7 @@ pub struct NS {
        /// This is also the zone which the server at [`Self::name_server`] is responsible for handling
        /// queries for.
        pub name: Name,
-       /// The name of the server which is responsible for handling queries for the [`Self::name`]
+       /// The name of the server which is responsible for handling queries for the [`self.name`]
        /// zone.
        pub name_server: Name,
 }
index 7b2fab98a71b54cf92b125aaf0405caa050ded29..ae0bb58f15de418ecc7305695374d4d8fcd89abd 100644 (file)
@@ -209,7 +209,7 @@ pub struct VerifiedRRStream<'a> {
        /// The set of verified [`RR`]s.
        ///
        /// These are not valid unless the current UNIX time is between [`Self::valid_from`] and
-       /// [`Self::expiration`].
+       /// [`Self::expires`].
        pub verified_rrs: Vec<&'a RR>,
        /// The latest [`RRSig::inception`] of all the [`RRSig`]s validated to verify
        /// [`Self::verified_rrs`].
@@ -253,8 +253,8 @@ fn resolve_time(time: u32) -> u64 {
 /// All records which could be validated are returned, though if an error is found validating any
 /// contained record, only `Err` will be returned.
 ///
-/// You MUST check that the current UNIX time is between [`VerifiedRRStream::latest_inception`] and
-/// [`VerifiedRRStream::earliest_expiry`].
+/// You MUST check that the current UNIX time is between [`VerifiedRRStream::valid_from`] and
+/// [`VerifiedRRStream::expires`].
 pub fn verify_rr_stream<'a>(inp: &'a [RR]) -> Result<VerifiedRRStream<'a>, ValidationError> {
        let mut zone = ".";
        let mut res = Vec::new();
diff --git a/test.sh b/test.sh
index 3346b74f123ce084c7d61d64a404249c7d75a238..240c0b66d4a8f39d1ecb7719e5651f5822ebb660 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -9,3 +9,4 @@ cargo build --lib
 cargo build --lib --features std
 cargo build --lib --features tokio
 cargo build --bin http_proof_gen --features build_server
+cargo doc --features std,tokio,validation