From 8b74001a1363d183e47c37848a5b8c4e8e8d2613 Mon Sep 17 00:00:00 2001 From: En-En <39373446+En-En-Code@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:01:40 +0000 Subject: [PATCH] fix: prevent copy tests from failing in Rust 1.90 Issue where changed: https://github.com/rust-lang/rust/issues/139956 Comment noting breakage of non-socket converted to UnixStream: 'https://github.com/rust-lang/rust/pull/140005#issuecomment-2853932531' Bumps MSRV from 1.83.0 to 1.87.0 by use of PipeWriter --- Cargo.toml | 2 +- testwl/src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index db6028d..7c6151e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ rustix = "0.38.31" all = "deny" [workspace.package] -rust-version = "1.83.0" +rust-version = "1.87.0" [package] name = "xwayland-satellite" diff --git a/testwl/src/lib.rs b/testwl/src/lib.rs index 1d4e2c1..8ac45c5 100644 --- a/testwl/src/lib.rs +++ b/testwl/src/lib.rs @@ -1,6 +1,6 @@ use std::collections::{hash_map, HashMap, HashSet}; use std::io::Read; -use std::io::Write; +use std::io::{PipeWriter, Write}; use std::os::fd::{AsFd, BorrowedFd, OwnedFd}; use std::os::unix::net::UnixStream; use std::sync::{Arc, Mutex, OnceLock}; @@ -1134,7 +1134,7 @@ impl Dispatch> for State { .position(|data| data.mime_type == mime_type) .unwrap_or_else(|| panic!("Invalid mime type: {mime_type}")); - let mut stream = UnixStream::from(fd); + let mut stream = PipeWriter::from(fd); stream.write_all(&data[pos].data).unwrap(); } Request::Destroy => {} @@ -1219,7 +1219,7 @@ impl Dispatch> for State { .position(|data| data.mime_type == mime_type) .unwrap_or_else(|| panic!("Invalid mime type: {mime_type}")); - let mut stream = UnixStream::from(fd); + let mut stream = PipeWriter::from(fd); stream.write_all(&data[pos].data).unwrap(); } wl_data_offer::Request::Destroy => {}