mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-07 00:00:09 +02:00
ci: workaround for OpenOptionsExt in 1.94.0 (#7968)
This commit is contained in:
@@ -15,7 +15,7 @@ env:
|
||||
RUST_BACKTRACE: 1
|
||||
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
|
||||
# Change to specific Rust release to pin
|
||||
rust_stable: '1.93.1'
|
||||
rust_stable: stable
|
||||
rust_nightly: nightly-2025-10-12
|
||||
# Pin a specific miri version
|
||||
rust_miri_nightly: nightly-2025-11-13
|
||||
@@ -1057,6 +1057,8 @@ jobs:
|
||||
target:
|
||||
- wasm32-wasip1
|
||||
- wasm32-wasip1-threads
|
||||
env:
|
||||
rust_stable: '1.93.1'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Rust ${{ env.rust_stable }}
|
||||
|
||||
@@ -16,9 +16,9 @@ use mock_open_options::MockOpenOptions as StdOpenOptions;
|
||||
#[cfg(not(test))]
|
||||
use std::fs::OpenOptions as StdOpenOptions;
|
||||
|
||||
#[cfg(unix)]
|
||||
#[cfg(all(unix, not(test)))]
|
||||
use std::os::unix::fs::OpenOptionsExt;
|
||||
#[cfg(windows)]
|
||||
#[cfg(all(windows, not(test)))]
|
||||
use std::os::windows::fs::OpenOptionsExt;
|
||||
|
||||
/// Options and flags which can be used to configure how a file is opened.
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
use mockall::mock;
|
||||
|
||||
use crate::fs::mocks::MockFile;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::OpenOptionsExt;
|
||||
#[cfg(windows)]
|
||||
use std::os::windows::fs::OpenOptionsExt;
|
||||
use std::{io, path::Path};
|
||||
|
||||
mock! {
|
||||
@@ -19,21 +15,25 @@ mock! {
|
||||
pub fn read(&mut self, read: bool) -> &mut Self;
|
||||
pub fn truncate(&mut self, truncate: bool) -> &mut Self;
|
||||
pub fn write(&mut self, write: bool) -> &mut Self;
|
||||
|
||||
// Not mocking OpenOptionsExt trait due to:
|
||||
// https://github.com/rust-lang/rust/issues/153486
|
||||
#[cfg(unix)]
|
||||
pub fn custom_flags(&mut self, flags: i32) -> &mut Self;
|
||||
#[cfg(unix)]
|
||||
pub fn mode(&mut self, mode: u32) -> &mut Self;
|
||||
#[cfg(windows)]
|
||||
pub fn access_mode(&mut self, access: u32) -> &mut Self;
|
||||
#[cfg(windows)]
|
||||
pub fn share_mode(&mut self, val: u32) -> &mut Self;
|
||||
#[cfg(windows)]
|
||||
pub fn custom_flags(&mut self, flags: u32) -> &mut Self;
|
||||
#[cfg(windows)]
|
||||
pub fn attributes(&mut self, val: u32) -> &mut Self;
|
||||
#[cfg(windows)]
|
||||
pub fn security_qos_flags(&mut self, flags: u32) -> &mut Self;
|
||||
}
|
||||
impl Clone for OpenOptions {
|
||||
fn clone(&self) -> Self;
|
||||
}
|
||||
#[cfg(unix)]
|
||||
impl OpenOptionsExt for OpenOptions {
|
||||
fn custom_flags(&mut self, flags: i32) -> &mut Self;
|
||||
fn mode(&mut self, mode: u32) -> &mut Self;
|
||||
}
|
||||
#[cfg(windows)]
|
||||
impl OpenOptionsExt for OpenOptions {
|
||||
fn access_mode(&mut self, access: u32) -> &mut Self;
|
||||
fn share_mode(&mut self, val: u32) -> &mut Self;
|
||||
fn custom_flags(&mut self, flags: u32) -> &mut Self;
|
||||
fn attributes(&mut self, val: u32) -> &mut Self;
|
||||
fn security_qos_flags(&mut self, flags: u32) -> &mut Self;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
use std::{io, os::unix::fs::OpenOptionsExt};
|
||||
use std::io;
|
||||
|
||||
#[cfg(not(test))]
|
||||
use std::os::unix::fs::OpenOptionsExt;
|
||||
|
||||
#[cfg(test)]
|
||||
use super::mock_open_options::MockOpenOptions as StdOpenOptions;
|
||||
|
||||
Reference in New Issue
Block a user