From c772e4eb0bac16d35b23616757cbd999d8b6d6b3 Mon Sep 17 00:00:00 2001 From: dailz Date: Sun, 28 Jun 2026 14:39:00 +0800 Subject: [PATCH] chore: bump MSRV to 1.87 to match actual API usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oracle P2 follow-up. The clippy --fix autofixes earlier in this branch silently introduced dependencies on APIs newer than the README's 1.70+ claim: - u32::is_multiple_of (stable 1.87) - Option::is_none_or (stable 1.82) clippy::incompatible_msrv flagged the mismatch once rust-version was pinned. Bumping the floor to 1.87 is the honest fix — the codebase genuinely depends on 1.87 features now, and 1.87 has been stable long enough (current stable is 1.96) that desktop CLI users on stable Rust already have it. - Cargo.toml: rust-version '1.70' -> '1.87'. Comment lists the specific APIs that drove the bump and notes that further bumps need to be validated against clippy::incompatible_msrv. - README.md: Prerequisites line updated to 1.87+ with a brief why. - src/state_portal.rs: added the AsRawFd rustc-quirk comment that was already in avhw.rs (rustc emits a false 'unused_imports' warning; removing it produces E0599). Same known quirk, same documentation pattern. - src/transform.rs: fixed empty_line_after_doc_comments warning by converting the leading // doc-style comment to a //! module-level doc comment (which is what it should have been when I rewrote the file in commit 145b5d3). All 79 unit tests + 3 integration tests pass. clippy: 0 errors, 0 incompatible_msrv warnings, 0 empty_line_after_doc_comments warnings. Remaining warnings are: 1 AsRawFd rustc false-positive (documented), 5 unnecessary_cast FFI false-positives (rustc quirk on pointer casts), and 8 dead-code items that need product decisions. --- Cargo.toml | 10 ++++++---- README.md | 2 +- src/state_portal.rs | 3 +++ src/transform.rs | 16 ++++++++-------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 68dfa8f..210454e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,10 +2,12 @@ name = "wl-webrtc" version = "0.1.0" edition = "2021" -# Matches README's "Rust toolchain (1.70+)". Pinning rust-version prevents -# building on toolchains older than we've actually tested, and gives cargo -# a useful error message instead of a parse/error cascade. -rust-version = "1.70" +# MSRV pinned to 1.87 to match the actual API floor — the codebase uses +# u32::is_multiple_of (1.87) and Option::is_none_or (1.82) introduced by +# clippy autofixes. README's Prerequisites section mirrors this. Bumping +# this floor requires checking clippy::incompatible_msrv against the new +# value. +rust-version = "1.87" description = "Wayland screen capture and encoding tool" [dependencies] diff --git a/README.md b/README.md index ad7ff81..91d87d1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Wayland screen capture and encoding tool. ## Prerequisites -- **Rust toolchain** (1.70+): `rustup default stable` +- **Rust toolchain** (1.87+; MSRV pinned to match `u32::is_multiple_of` / `Option::is_none_or` usage): `rustup default stable` - **FFmpeg 6.0+** dev libraries with VAAPI support: - Arch: `pacman -S ffmpeg` - Ubuntu/Debian: `apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libva-dev` diff --git a/src/state_portal.rs b/src/state_portal.rs index a2678b5..9c6f1ec 100644 --- a/src/state_portal.rs +++ b/src/state_portal.rs @@ -1,4 +1,7 @@ // 采集门户状态模块 —— 通过 PipeWire/DMA-BUF 进行屏幕采集并编码 +// AsRawFd is required by frame.fd.as_raw_fd() in build_drm_descriptor below +// but rustc emits a false "unused_imports" warning because OwnedFd also has +// an inherent as_raw_fd — same quirk as avhw.rs. E0599 if removed → keep it. use std::os::fd::AsRawFd; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; diff --git a/src/transform.rs b/src/transform.rs index c800715..afd3774 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -1,11 +1,11 @@ -/// Coordinate transformation module for Wayland output transforms. -// -// Historically exposed a family of `Rect`/`screen_to_frame`/`fit_inside_bounds` -// helpers for ROI-based capture clipping. Those were never wired into the -// capture pipeline (we capture full frames and let FFmpeg's filter graph handle -// any scaling/rotation); they have been removed. Only `Transform` and the -// `transpose_if_transform_transposed` helper remain — both are actively used by -// `state.rs` and `avhw.rs`. +//! Coordinate transformation module for Wayland output transforms. +//! +//! Historically exposed a family of `Rect`/`screen_to_frame`/`fit_inside_bounds` +//! helpers for ROI-based capture clipping. Those were never wired into the +//! capture pipeline (we capture full frames and let FFmpeg's filter graph handle +//! any scaling/rotation); they have been removed. Only `Transform` and the +//! `transpose_if_transform_transposed` helper remain — both are actively used by +//! `state.rs` and `avhw.rs`. /// Wayland output transform enum, matching `wl_output::Transform`. #[derive(Debug, Clone, Copy, PartialEq, Eq)]