Skip to content

Commit aa65400

Browse files
committed
lol this ices again
Signed-off-by: Eliza Weisman <[email protected]>
1 parent b811dbe commit aa65400

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

maitake/src/task.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -522,22 +522,27 @@ feature! {
522522

523523
feature! {
524524
#![not(loom)]
525-
pub unsafe fn nop(_ptr: TaskRef) -> Poll<()> {
526-
#[cfg(debug_assertions)]
527-
unreachable!("stub task ({_ptr:?}) should never be polled!");
528-
#[cfg(not(debug_assertions))]
529-
Poll::Pending
530-
}
531-
532525

533-
pub unsafe fn nop_deallocate(ptr: NonNull<Header>) {
534-
unreachable!("stub task ({ptr:p}) should never be deallocated!");
526+
mod nop {
527+
use super::*;
528+
pub unsafe fn nop(_ptr: TaskRef) -> Poll<()> {
529+
#[cfg(debug_assertions)]
530+
unreachable!("stub task ({_ptr:?}) should never be polled!");
531+
#[cfg(not(debug_assertions))]
532+
Poll::Pending
533+
}
534+
535+
536+
pub unsafe fn nop_deallocate(ptr: NonNull<Header>) {
537+
unreachable!("stub task ({ptr:p}) should never be deallocated!");
538+
}
539+
535540
}
536541

537542
impl Vtable {
538543
const STUB: Vtable = Vtable {
539-
poll: nop,
540-
deallocate: nop_deallocate,
544+
poll: nop::nop,
545+
deallocate: nop::nop_deallocate,
541546
};
542547
}
543548

0 commit comments

Comments
 (0)