diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa0d32872..d41947157 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,19 +150,18 @@ jobs: with: submodules: true - - name: Install rust toolchain - id: toolchain + # nightly features are used for formatting + - name: Install rust nightly toolchain + id: nightly-toolchain run: | - rustup toolchain install stable --profile minimal - rustup override set stable - + rustup toolchain install nightly --profile minimal - uses: camshaft/rust-cache@v1 - name: Run cargo doc - run: cargo doc --all-features --no-deps --workspace --exclude s2n-quic-qns + run: cargo +nightly doc --all-features --no-deps --workspace --exclude s2n-quic-qns env: - RUSTDOCFLAGS: --cfg s2n_docs + RUSTDOCFLAGS: --cfg s2n_docsrs - uses: aws-actions/configure-aws-credentials@v4.0.2 if: github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name diff --git a/quic/s2n-quic/Cargo.toml b/quic/s2n-quic/Cargo.toml index e0e738d7f..dc37bbc46 100644 --- a/quic/s2n-quic/Cargo.toml +++ b/quic/s2n-quic/Cargo.toml @@ -91,3 +91,11 @@ s2n-quic-transport = { path = "../s2n-quic-transport", features = ["unstable_res tokio = { version = "1", features = ["full"] } tracing = { version = "0.1" } tracing-subscriber = { version = "0.3", features = ["env-filter"] } + +# Compile with the `s2n_docsrs` feature to enable feature tagging in rust docs. +# +# Docs.rs generates crates.io documentation using the nightly release of the Rust +# compiler. See documentation for additional configuration options: +# https://docs.rs/about/metadata +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "s2n_docsrs"]