Skip to content

Commit 53536ef

Browse files
committed
fix compile on rust 1.83.0
1 parent fdeb2c4 commit 53536ef

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
x86_64-pc-windows-msvc,
8787
i686-pc-windows-msvc,
8888
]
89-
channel: [ 1.81.0, nightly-2024-08-02 ]
89+
channel: [ stable, nightly ]
9090
include:
9191
- target: x86_64-unknown-linux-gnu
9292
os: ubuntu-latest

core/src/co_pool/mod.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::common::ordered_work_steal::{OrderedLocalQueue, OrderedWorkStealQueue
66
use crate::common::{get_timeout_time, now, CondvarBlocker};
77
use crate::coroutine::suspender::Suspender;
88
use crate::scheduler::{SchedulableCoroutine, Scheduler};
9-
use crate::{impl_current_for, impl_display_by_debug, impl_for_named, trace};
9+
use crate::{error, impl_current_for, impl_display_by_debug, impl_for_named, trace};
1010
use dashmap::DashMap;
1111
use std::cell::Cell;
1212
use std::ffi::c_longlong;
@@ -70,10 +70,9 @@ impl Drop for CoroutinePool<'_> {
7070
self.get_running_size(),
7171
"There are still tasks in progress !"
7272
);
73-
assert!(
74-
self.task_queue.is_empty(),
75-
"There are still tasks to be carried out !"
76-
);
73+
if !self.task_queue.is_empty() {
74+
error!("Forget some tasks when closing the pool");
75+
}
7776
}
7877
}
7978

core/src/syscall/windows/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<I: SelectSyscall> SelectSyscall for NioSelectSyscall<I> {
9797
}
9898
_ = EventLoops::wait_event(Some(Duration::from_millis(u64::from(t.min(x)))));
9999
if t != c_uint::MAX {
100-
t = if t > x { t - x } else { 0 };
100+
t = t.saturating_sub(x);
101101
}
102102
if x < 16 {
103103
x <<= 1;

open-coroutine/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,5 +214,6 @@ fn main() {
214214
}
215215
}
216216
// link dylib
217+
println!("cargo:rustc-link-search=native={}", deps.display());
217218
println!("cargo:rustc-link-lib=dylib=open_coroutine_hook");
218219
}

0 commit comments

Comments
 (0)