Skip to content

fix(dream_skin): fix Windows-only compile error breaking Windows CI - #2024

Open
LeoLin990405 wants to merge 1 commit into
BigPizzaV3:mainfrom
LeoLin990405:fix/windows-dream-skin-into-owned
Open

fix(dream_skin): fix Windows-only compile error breaking Windows CI#2024
LeoLin990405 wants to merge 1 commit into
BigPizzaV3:mainfrom
LeoLin990405:fix/windows-dream-skin-into-owned

Conversation

@LeoLin990405

Copy link
Copy Markdown
Contributor

Problem

main's Windows artifacts CI has been failing since 7385664 (last green) with a compile error:

error[E0599]: no method named `into_owned` found for struct `std::string::String`
  --> crates/codex-plus-core/src/dream_skin.rs:593:32

The #[cfg(windows)] normalized_identity_string builds raw as an owned String
(path.to_string_lossy().replace('/', "\\")), then calls raw.into_owned() in the final
unwrap_or_else. String has no into_owned() (that's Cow/Borrow), so it fails to
compile — but only on Windows, since the function is #[cfg(windows)] (non-Windows builds
use a separate branch, so macOS/Linux CI stays green and the break is easy to miss).

This blocks the Windows job for every PR rebased onto current main.

Fix

Return raw directly (it is already the owned String):

-        .unwrap_or_else(|| raw.into_owned());
+        .unwrap_or_else(|| raw);

The other into_owned() calls in the tree operate on Cow (to_string_lossy().into_owned())
and are fine; only this String case is wrong.

Verification

Since the function is #[cfg(windows)], verified with a Windows cross-target type-check
(rustc --target x86_64-pc-windows-msvc --emit=metadata on the isolated function):

  • original || raw.into_owned() → reproduces error[E0599];
  • fixed || raw → type-checks clean.

cargo check -p codex-plus-core on macOS stays green.

The `#[cfg(windows)]` normalized_identity_string calls `raw.into_owned()`
where `raw` is already an owned String (from `to_string_lossy().replace(..)`),
so it fails to compile on Windows with `error[E0599]: no method named
`into_owned` found for struct String`. This breaks the Windows artifacts CI on
main (green at 7385664, failing since). Return `raw` directly.

Verified via `rustc --target x86_64-pc-windows-msvc`: the original reproduces
E0599, the fix type-checks clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant