From 0298caf97a01c596d8811ddf44b81e04fdfac3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Sat, 20 Apr 2024 21:22:25 +0200 Subject: [PATCH] tokio-xmpp: allow docs build with --all-features This affects only the docs and is quite an ugly hack, but seems to be the only way for now. --- .gitlab-ci.yml | 2 +- tokio-xmpp/src/lib.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dcc8cdd..367cc4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,7 @@ variables: stage: test script: - echo "Building docs to CI_DOC_TARGET=$CI_DOC_TARGET" - - RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --no-deps -Zrustdoc-map + - RUSTDOCFLAGS="--cfg docsrs" RUSTFLAGS="--cfg xmpprs_doc_build" cargo +nightly doc --no-deps -Zrustdoc-map --all-features - apt install -y rsync openssh-client - mkdir -p $HOME/.ssh - echo -e "Host docs\n\tHostname docs.xmpp.rs\n\tPort 1312\n\tUser xmpp-rs\n\tStrictHostKeyChecking no" > $HOME/.ssh/config diff --git a/tokio-xmpp/src/lib.rs b/tokio-xmpp/src/lib.rs index 7d7503b..4899a4e 100644 --- a/tokio-xmpp/src/lib.rs +++ b/tokio-xmpp/src/lib.rs @@ -2,7 +2,12 @@ #![deny(unsafe_code, missing_docs, bare_trait_objects)] -#[cfg(all(feature = "tls-native", feature = "tls-rust"))] +#[cfg(all( + not(xmpprs_doc_build), + not(doc), + feature = "tls-native", + feature = "tls-rust" +))] compile_error!("Both tls-native and tls-rust features can't be enabled at the same time."); #[cfg(all(