From 9f453e7d0cd56c7f1ddec5165271aabbcc9d4891 Mon Sep 17 00:00:00 2001 From: pv42 Date: Mon, 26 Aug 2024 16:35:26 +0200 Subject: [PATCH 1/3] doc: add doc_auto_cfg feature to doc and docsrs build for mavlink and mavlink-core --- mavlink-core/src/lib.rs | 1 + mavlink/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/mavlink-core/src/lib.rs b/mavlink-core/src/lib.rs index 12d470b614..0d3273c62b 100644 --- a/mavlink-core/src/lib.rs +++ b/mavlink-core/src/lib.rs @@ -19,6 +19,7 @@ //! feature without also using the `uavionix` and `icarous` features. //! #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(any(docsrs, doc), feature(doc_auto_cfg))] #![deny(clippy::all)] #![warn(clippy::use_self)] diff --git a/mavlink/src/lib.rs b/mavlink/src/lib.rs index 3690dd954c..71790d96d9 100644 --- a/mavlink/src/lib.rs +++ b/mavlink/src/lib.rs @@ -1,4 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(any(docsrs, doc), feature(doc_auto_cfg))] // include generate definitions include!(concat!(env!("OUT_DIR"), "/mod.rs")); From 48386bea86de92cd467a896aeab80abdb1ddb046 Mon Sep 17 00:00:00 2001 From: pv42 Date: Mon, 26 Aug 2024 16:37:11 +0200 Subject: [PATCH 2/3] test: switch docs test to nightly, add all features used for docs.rs --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c4c02f44d3..60f4ca1f96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -126,9 +126,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@master - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@nightly - name: Build docs - run: cargo doc + run: cargo doc --features "default all-dialects emit-description emit-extensions format-generated-code tokio-1 signing" - name: Deploy uses: peaceiris/actions-gh-pages@v3 if: ${{ github.ref == 'refs/heads/master' }} From acc69e760743b9245d6d049036e2f2afabc54d2c Mon Sep 17 00:00:00 2001 From: pv42 Date: Mon, 26 Aug 2024 16:57:23 +0200 Subject: [PATCH 3/3] test: disable doc_auto_cfg for doctest --- mavlink-core/src/lib.rs | 2 +- mavlink/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mavlink-core/src/lib.rs b/mavlink-core/src/lib.rs index 0d3273c62b..2ef674b104 100644 --- a/mavlink-core/src/lib.rs +++ b/mavlink-core/src/lib.rs @@ -19,7 +19,7 @@ //! feature without also using the `uavionix` and `icarous` features. //! #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(any(docsrs, doc), feature(doc_auto_cfg))] +#![cfg_attr(all(any(docsrs, doc), not(doctest)), feature(doc_auto_cfg))] #![deny(clippy::all)] #![warn(clippy::use_self)] diff --git a/mavlink/src/lib.rs b/mavlink/src/lib.rs index 71790d96d9..bfdcbeafb2 100644 --- a/mavlink/src/lib.rs +++ b/mavlink/src/lib.rs @@ -1,5 +1,5 @@ #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(any(docsrs, doc), feature(doc_auto_cfg))] +#![cfg_attr(all(any(docsrs, doc), not(doctest)), feature(doc_auto_cfg))] // include generate definitions include!(concat!(env!("OUT_DIR"), "/mod.rs"));