From 3b9c26fbd8a68feb59f8f66f9b1ec456440408fe Mon Sep 17 00:00:00 2001 From: Jan Niehusmann Date: Fri, 29 Jul 2022 16:22:49 +0000 Subject: [PATCH] Remove separation of stable vs. nightly implementations in executor/raw Since rust 1.61, the required const features are availabe on stable rust --- embassy/src/executor/raw/mod.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/embassy/src/executor/raw/mod.rs b/embassy/src/executor/raw/mod.rs index 7e855916..0cfe617e 100644 --- a/embassy/src/executor/raw/mod.rs +++ b/embassy/src/executor/raw/mod.rs @@ -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 { } impl TaskStorage { - #[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 TaskStorage { } } - /// 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 Sync for TaskStorage {} /// Raw storage that can hold up to N tasks of the same type. /// /// This is essentially a `[TaskStorage; N]`. -#[cfg(feature = "nightly")] pub struct TaskPool { pool: [TaskStorage; N], } -#[cfg(feature = "nightly")] impl TaskPool { /// Create a new TaskPool, with all tasks in non-spawned state. pub const fn new() -> Self {