Repository navigation
obs-util: Allow target-dependent wchar_t and c_char casts - #1485
Merged
Merged
Conversation
The release gate's cross lint runs clippy -D warnings on aarch64-unknown-linux-gnu, where wchar_t is u32 and c_char is u8, so `as u32` / `as u8` on them are no-ops there and clippy's unnecessary_cast fails the release. They are needed on x86-64 Linux and macOS (i32 / i8), which is why the PR gate passes. Keep the casts and allow the lint with a comment where the type depends on the target, as ffi/dstr.rs and platform/unix/nix.rs already do: File::open_wide and mbs_to_utf8 in platform/unix/file.rs, and ffi/cf_parser.rs (from obs-rust#1467). Fixes obs-rust#1484
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1484
What and why
The release gate's Rust Cross Lint fails on
aarch64-unknown-linux-gnu, which blocks the daily release (none since 0.1.0-beta.20261018) and the scheduled full run. clippy'sunnecessary_castfires on casts of C character types that are signed on the PR-gate targets and unsigned on aarch64 Linux.rust/obs-util/src/platform/unix/file.rs:File::open_wideandmbs_to_utf8convertwchar_twithas u32.wchar_tisi32on x86-64 Linux and macOS andu32on aarch64 Linux.rust/obs-util/src/ffi/cf_parser.rs(from obs-util: port cf-parser (#1466) #1467):as u8onc_char, which isu8on aarch64 Linux and aarch64-pc-windows-msvc.ffi/dstr.rsandplatform/unix/nix.rsalready do. No code changes behaviour.RED → GREEN
casting to the same type is unnecessary (u32 -> u32)at file.rs:55 and :158. On current master,cargo clippy -p obs-util --lib --target aarch64-unknown-linux-gnu -- -D warningsalso reports the three cf_parser.rs casts (u8 -> u8at :39 and twice at :56). This is a lint-only change, so there is no test commit.uv run ci/local_gate.py --lane cross-release(clippy and dylint, workspace, on aarch64-pc-windows-msvc, x86_64-apple-darwin and aarch64-unknown-linux-gnu) passes on this head.cargo clippy -p obs-util -- -D warningsalso passes on x86_64-unknown-linux-gnu and aarch64-apple-darwin.Checklist
masterdocs/features.mdis added or updated (not applicable: no user-visible change)