Remove separation of stable vs. nightly implementations in executor/raw
Since rust 1.61, the required const features are availabe on stable rust
This commit is contained in:
parent
0f4c0311fe
commit
3b9c26fbd8
1 changed files with 0 additions and 29 deletions
|
@ -57,7 +57,6 @@ pub struct TaskHeader {
|
|||
}
|
||||
|
||||
impl TaskHeader {
|
||||
#[cfg(feature = "nightly")]
|
||||
pub(crate) const fn new() -> Self {
|
||||
Self {
|
||||
state: AtomicU32::new(0),
|
||||
|
@ -72,21 +71,6 @@ impl TaskHeader {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
pub(crate) fn new() -> Self {
|
||||
Self {
|
||||
state: AtomicU32::new(0),
|
||||
run_queue_item: RunQueueItem::new(),
|
||||
executor: Cell::new(ptr::null()),
|
||||
poll_fn: UninitCell::uninit(),
|
||||
|
||||
#[cfg(feature = "time")]
|
||||
expires_at: Cell::new(Instant::from_ticks(0)),
|
||||
#[cfg(feature = "time")]
|
||||
timer_queue_item: timer_queue::TimerQueueItem::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) unsafe fn enqueue(&self) {
|
||||
critical_section::with(|cs| {
|
||||
let state = self.state.load(Ordering::Relaxed);
|
||||
|
@ -128,11 +112,9 @@ pub struct TaskStorage<F: Future + 'static> {
|
|||
}
|
||||
|
||||
impl<F: Future + 'static> TaskStorage<F> {
|
||||
#[cfg(feature = "nightly")]
|
||||
const NEW: Self = Self::new();
|
||||
|
||||
/// Create a new TaskStorage, in not-spawned state.
|
||||
#[cfg(feature = "nightly")]
|
||||
pub const fn new() -> Self {
|
||||
Self {
|
||||
raw: TaskHeader::new(),
|
||||
|
@ -140,15 +122,6 @@ impl<F: Future + 'static> TaskStorage<F> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Create a new TaskStorage, in not-spawned state.
|
||||
#[cfg(not(feature = "nightly"))]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
raw: TaskHeader::new(),
|
||||
future: UninitCell::uninit(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Try to spawn the task.
|
||||
///
|
||||
/// The `future` closure constructs the future. It's only called if spawning is
|
||||
|
@ -210,12 +183,10 @@ unsafe impl<F: Future + 'static> Sync for TaskStorage<F> {}
|
|||
/// Raw storage that can hold up to N tasks of the same type.
|
||||
///
|
||||
/// This is essentially a `[TaskStorage<F>; N]`.
|
||||
#[cfg(feature = "nightly")]
|
||||
pub struct TaskPool<F: Future + 'static, const N: usize> {
|
||||
pool: [TaskStorage<F>; N],
|
||||
}
|
||||
|
||||
#[cfg(feature = "nightly")]
|
||||
impl<F: Future + 'static, const N: usize> TaskPool<F, N> {
|
||||
/// Create a new TaskPool, with all tasks in non-spawned state.
|
||||
pub const fn new() -> Self {
|
||||
|
|
Loading…
Reference in a new issue