You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use core::{future::Future, pin::Pin};typeBoxFuture = Pin<Box<dynFuture<Output = ()> + Sync + 'static>>;pubstructScheduler{task:Option<BoxFuture>,}implScheduler{/// Adds a future to the scheduler's task list, returning a JoinHandlepubfnspawn<F:Future<Output = ()> + Sync + 'static>(&mutself,fut:F){self.task = Some(Box::pin(fut));}}/// Polls the given future and the tasks it may spawn until all of them complete////// Contrary to block_on, this allows `spawn`ing other futurespubfnspawnable_block_on<F:Future<Output = ()> + Sync + 'static>(scheduler:&mutScheduler,fut:F){
scheduler.spawn(fut);}/// Sender of a channel.pubstructSender{}implSender{pubasyncfnsend(&self){}}#[kani::proof]fncheck(){letmut scheduler = Scheduler{task:None};spawnable_block_on(&mut scheduler,async{let num:usize = 1;let tx = Sender{};let _task1 = asyncmove{for _i in0..num {
tx.send().await;}};});}
Running that with RUSTFLAGS="--edition 2018" kani unbounded.rs produces the same crash.
I tried this code:
https://github.com/ytakano/kani_compile_error_simple_channel/blob/master/src/unbounded.rs
runner.rs in this repository is equivalent to manual_spawn.rs of Kani.
using the following command line invocation:
with Kani version:
The text was updated successfully, but these errors were encountered: