From https://rust-lang.github.io/async-book/03_async_await/01_chapter.html:
Note that, when using a multithreaded
Futureexecutor, aFuturemay move between threads, so any variables used inasyncbodies must be able to travel between threads, as any.awaitcan potentially result in a switch to a new thread.
This means that it is not safe to useRc,&RefCellor any other types that don't implement theSendtrait, including references to types that don't implement theSynctrait.
Does Rust actually compiles when Rc is referenced in an async body? I.e., should I manually think about this situation, or will Rust make sure such situation always cause a compile error?