diff --git a/.github/actions/rust/action.yml b/.github/actions/rust/action.yml index df10b5848..473c326c1 100644 --- a/.github/actions/rust/action.yml +++ b/.github/actions/rust/action.yml @@ -32,7 +32,7 @@ runs: - name: Install Rust tools shell: bash - run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph + run: cargo +${{ inputs.version }} binstall --no-confirm cargo-llvm-cov cargo-nextest flamegraph cargo-hack - name: Use Rust cache uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8ce5383db..c92114a98 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -142,7 +142,12 @@ jobs: if: success() || failure() - name: Clippy - run: cargo +${{ matrix.rust-toolchain }} clippy --all-targets -- -D warnings || ${{ matrix.rust-toolchain == 'nightly' }} + run: | + # Use cargo-hack to run clippy on each crate individually with its + # respective default features only. Can reveal warnings otherwise + # hidden given that a plain cargo clippy combines all features of the + # workspace. See e.g. https://github.com/mozilla/neqo/pull/1695. + cargo +${{ matrix.rust-toolchain }} hack clippy --all-targets -- -D warnings || ${{ matrix.rust-toolchain == 'nightly' }} if: success() || failure() - name: Check rustdoc links diff --git a/neqo-common/src/datagram.rs b/neqo-common/src/datagram.rs index d6ed43bde..04ba1a45a 100644 --- a/neqo-common/src/datagram.rs +++ b/neqo-common/src/datagram.rs @@ -54,6 +54,7 @@ impl Datagram { self.ttl } + #[cfg(feature = "udp")] #[must_use] pub(crate) fn into_data(self) -> Vec { self.d