fix(build): repair the macOS build#618
Open
fchorney wants to merge 1 commit into
Open
Conversation
main does not compile on macOS with stable Rust. Both faults are inside macOS-only cfg blocks, so CI on other targets stays green. 1. deadlib-renderer window_size.rs: macos_opengl_low_dpi is a const fn that compares BackendType with ==, which calls PartialEq::eq. That is not callable in a const fn on stable (it needs const_trait_impl), so the crate fails with E0015. Use matches! instead: pattern matching needs no trait call, and the function stays const. 2. deadsync-shell window.rs: the with_disallow_hidpi call arrived here without its trait. WindowAttributesExtMacOS is in scope in window_size.rs, where the call used to live, but not in window.rs, so the crate fails with E0599. Import the trait, cfg-gated like the call site. Also drop WindowAttributesExtMacOS from window_size.rs, which no longer uses it now that the call moved: on macOS it was an unused import. No behaviour change on any target.
This was referenced Jul 10, 2026
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.
Summary
maindoes not compile on macOS with stable Rust. Both faults sit inside#[cfg(target_os = "macos")]blocks, which is why CI on the other targets stays green.Reproduced on a clean worktree at
146d8241, stablerustc 1.96.0,aarch64-apple-darwin. No behaviour change on any target.1.
const fncallingPartialEq(crates/deadlib-renderer/src/window_size.rs)==goes throughPartialEq::eq, which is not callable in aconst fnon stable (it needsconst_trait_impl). Introduced byde4a1c5b.Fixed with
matches!, which pattern-matches instead of calling a trait method, so the function staysconst:2. Missing trait import (
crates/deadsync-shell/src/window.rs)The method exists in winit 0.30.13, but its trait
WindowAttributesExtMacOSis not in scope here. The call moved intowindow.rsduring146d8241without its import;window_size.rs, where it used to live, still imports the trait. Fixed by importing it,cfg-gated to match the call site.3. Unused import (
crates/deadlib-renderer/src/window_size.rs)Following from 2,
window_size.rsno longer usesWindowAttributesExtMacOS, so on macOS it was an unused import. Dropped.Testing
cargo checkandcargo clippyare clean on macOS with this branch; both fail onmainwithout it.cargo fmt --checkclean. The only remainingcargo checkwarnings are the pre-existing ones indeadsync-audioanddeadsync-config.Noticed while rebasing #616 / #617; those PRs are unaffected by this and do not depend on it.