Skip to content

Instantly share code, notes, and snippets.

@fzyzcjy
Created December 4, 2023 10:04
Show Gist options
  • Save fzyzcjy/7f808c0061ce039491057646839445e9 to your computer and use it in GitHub Desktop.
Save fzyzcjy/7f808c0061ce039491057646839445e9 to your computer and use it in GitHub Desktop.
Compiling bug v0.1.0 (/Users/tom/temp/bug)
error[E0277]: the type `UnsafeCell<runtime::blocking::pool::Shared>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::blocking::pool::Shared>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::blocking::pool::Shared>`
note: required because it appears within the type `Mutex<RawMutex, Shared>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<Shared>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:74:8
|
74 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Spawner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:23:19
|
23 | pub(crate) struct Spawner {
| ^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<AtomicUsize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<AtomicUsize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<AtomicUsize>`
note: required because it appears within the type `AtomicUsize`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/atomic_usize.rs:6:19
|
6 | pub(crate) struct AtomicUsize {
| ^^^^^^^^^^^
note: required because it appears within the type `Shared<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/inject/shared.rs:9:19
|
9 | pub(crate) struct Shared<T: 'static> {
| ^^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::scheduler::multi_thread::worker::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::scheduler::multi_thread::worker::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::scheduler::multi_thread::worker::Synced>`
note: required because it appears within the type `Mutex<RawMutex, Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<Vec<Box<runtime::scheduler::multi_thread::worker::Core>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<Vec<Box<runtime::scheduler::multi_thread::worker::Core>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<Vec<Box<runtime::scheduler::multi_thread::worker::Core>>>`
note: required because it appears within the type `Mutex<RawMutex, Vec<Box<Core>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<Vec<Box<Core>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `(dyn Fn() -> String + Send + Sync + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `(dyn Fn() -> String + Send + Sync + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `(dyn Fn() -> String + Send + Sync + 'static)`
note: required because it appears within the type `ArcInner<dyn Fn() -> String + Send + Sync>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<dyn Fn() -> String + Send + Sync>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<dyn Fn() -> String + Send + Sync>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:74:8
|
74 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Spawner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:23:19
|
23 | pub(crate) struct Spawner {
| ^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
help: use parentheses to call this trait object
|
10 | }());
| ++
error[E0277]: the type `UnsafeCell<Option<()>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<Option<()>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<Option<()>>`
note: required because it appears within the type `UnsafeCell<Option<()>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/unsafe_cell.rs:2:19
|
2 | pub(crate) struct UnsafeCell<T>(std::cell::UnsafeCell<T>);
| ^^^^^^^^^^
note: required because it appears within the type `Inner<()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/sync/oneshot.rs:379:8
|
379 | struct Inner<T> {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner<()>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner<()>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner<()>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Option<Arc<Inner<()>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:563:10
|
563 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `Receiver<()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/sync/oneshot.rs:322:12
|
322 | pub struct Receiver<T> {
| ^^^^^^^^
note: required because it appears within the type `Receiver`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/shutdown.rs:17:19
|
17 | pub(super) struct Receiver {
| ^^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::scheduler::inject::synced::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::scheduler::inject::synced::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::scheduler::inject::synced::Synced>`
note: required because it appears within the type `Mutex<RawMutex, Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Inject<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/inject.rs:25:19
|
25 | pub(crate) struct Inject<T: 'static> {
| ^^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:72:8
|
72 | struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::current_thread::Handle>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::current_thread::Handle>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::current_thread::Handle>>>`
note: required because it appears within the type `Mutex<RawMutex, CountedOwnedTasksInner<Arc<Handle>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<CountedOwnedTasksInner<Arc<Handle>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `OwnedTasks<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/list.rs:57:19
|
57 | pub(crate) struct OwnedTasks<S: 'static> {
| ^^^^^^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:72:8
|
72 | struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::multi_thread::handle::Handle>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::multi_thread::handle::Handle>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::task::list::CountedOwnedTasksInner<Arc<runtime::scheduler::multi_thread::handle::Handle>>>`
note: required because it appears within the type `Mutex<RawMutex, CountedOwnedTasksInner<Arc<Handle>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<CountedOwnedTasksInner<Arc<Handle>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `OwnedTasks<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/task/list.rs:57:19
|
57 | pub(crate) struct OwnedTasks<S: 'static> {
| ^^^^^^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `(dyn Fn() + Send + Sync + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `(dyn Fn() + Send + Sync + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `(dyn Fn() + Send + Sync + 'static)`
note: required because it appears within the type `ArcInner<dyn Fn() + Send + Sync>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<dyn Fn() + Send + Sync>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<dyn Fn() + Send + Sync>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Option<Arc<dyn Fn() + Send + Sync>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:563:10
|
563 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:74:8
|
74 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Spawner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:23:19
|
23 | pub(crate) struct Spawner {
| ^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
help: use parentheses to call this trait object
|
10 | }());
| ++
error[E0277]: the type `UnsafeCell<MaybeUninit<Waker>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<MaybeUninit<Waker>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<MaybeUninit<Waker>>`
note: required because it appears within the type `UnsafeCell<MaybeUninit<Waker>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/unsafe_cell.rs:2:19
|
2 | pub(crate) struct UnsafeCell<T>(std::cell::UnsafeCell<T>);
| ^^^^^^^^^^
note: required because it appears within the type `Task`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/sync/oneshot.rs:404:8
|
404 | struct Task(UnsafeCell<MaybeUninit<Waker>>);
| ^^^^
note: required because it appears within the type `Inner<()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/sync/oneshot.rs:379:8
|
379 | struct Inner<T> {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner<()>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner<()>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner<()>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Option<Arc<Inner<()>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:563:10
|
563 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `Receiver<()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/sync/oneshot.rs:322:12
|
322 | pub struct Receiver<T> {
| ^^^^^^^^
note: required because it appears within the type `Receiver`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/shutdown.rs:17:19
|
17 | pub(super) struct Receiver {
| ^^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::io::registration_set::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::io::registration_set::Synced>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::io::registration_set::Synced>`
note: required because it appears within the type `Mutex<RawMutex, Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<Synced>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/io/driver.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `IoHandle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/driver.rs:138:21
|
138 | pub(crate) enum IoHandle {
| ^^^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/driver.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::time::InnerState>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::time::InnerState>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::time::InnerState>`
note: required because it appears within the type `Mutex<RawMutex, InnerState>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<InnerState>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/time/mod.rs:92:8
|
92 | struct Inner {
| ^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/time/handle.rs:5:19
|
5 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `Option<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:563:10
|
563 | pub enum Option<T> {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/driver.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<libc::unix::bsd::apple::pthread_cond_t>`
note: required because it appears within the type `AllocatedCondvar`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_condvar.rs:12:8
|
12 | struct AllocatedCondvar(UnsafeCell<libc::pthread_cond_t>);
| ^^^^^^^^^^^^^^^^
note: required because it appears within the type `PhantomData<AllocatedCondvar>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `LazyBox<AllocatedCondvar>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/lazy_box.rs:13:19
|
13 | pub(crate) struct LazyBox<T: LazyInit> {
| ^^^^^^^
note: required because it appears within the type `Condvar`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys/unix/locks/pthread_condvar.rs:14:12
|
14 | pub struct Condvar {
| ^^^^^^^
note: required because it appears within the type `Condvar`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sync/condvar.rs:107:12
|
107 | pub struct Condvar {
| ^^^^^^^
note: required because it appears within the type `PhantomData<Condvar>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Condvar`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:28:19
|
28 | pub(crate) struct Condvar(PhantomData<std::sync::Condvar>, parking_lot::Condvar);
| ^^^^^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:74:8
|
74 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Spawner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:23:19
|
23 | pub(crate) struct Spawner {
| ^^^^^^^
note: required because it appears within the type `BlockingPool`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/blocking/pool.rs:17:19
|
17 | pub(crate) struct BlockingPool {
| ^^^^^^^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<()>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<()>`
note: required because it appears within the type `Mutex<RawMutex, ()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lock_api-0.4.11/src/mutex.rs:142:12
|
142 | pub struct Mutex<R, T: ?Sized> {
| ^^^^^
note: required because it appears within the type `Mutex<()>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/parking_lot.rs:22:19
|
22 | pub(crate) struct Mutex<T: ?Sized>(PhantomData<std::sync::Mutex<T>>, parking_lot::Mutex<T>);
| ^^^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/park.rs:21:8
|
21 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `UnparkThread`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/park.rs:16:19
|
16 | pub(crate) struct UnparkThread {
| ^^^^^^^^^^^^
note: required because it appears within the type `IoHandle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/driver.rs:138:21
|
138 | pub(crate) enum IoHandle {
| ^^^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/driver.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/current_thread/mod.rs:32:19
|
32 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<AtomicU32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<AtomicU32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<AtomicU32>`
note: required because it appears within the type `AtomicU32`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/atomic_u32.rs:6:19
|
6 | pub(crate) struct AtomicU32 {
| ^^^^^^^^^
note: required because it appears within the type `Inner<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/queue.rs:36:19
|
36 | pub(crate) struct Inner<T: 'static> {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner<Arc<Handle>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner<Arc<Handle>>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner<Arc<Handle>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Steal<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/queue.rs:34:19
|
34 | pub(crate) struct Steal<T: 'static>(Arc<Inner<T>>);
| ^^^^^
note: required because it appears within the type `Remote`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:201:8
|
201 | struct Remote {
| ^^^^^^
= note: required because it appears within the type `[Remote]`
note: required because it appears within the type `PhantomData<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Unique<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/unique.rs:37:12
|
37 | pub struct Unique<T: ?Sized> {
| ^^^^^^
note: required because it appears within the type `Box<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:195:12
|
195 | pub struct Box<
| ^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<MaybeUninit<runtime::task::Notified<Arc<runtime::scheduler::multi_thread::handle::Handle>>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<MaybeUninit<runtime::task::Notified<Arc<runtime::scheduler::multi_thread::handle::Handle>>>>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<MaybeUninit<runtime::task::Notified<Arc<runtime::scheduler::multi_thread::handle::Handle>>>>`
note: required because it appears within the type `UnsafeCell<MaybeUninit<Notified<Arc<Handle>>>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/loom/std/unsafe_cell.rs:2:19
|
2 | pub(crate) struct UnsafeCell<T>(std::cell::UnsafeCell<T>);
| ^^^^^^^^^^
= note: required because it appears within the type `[UnsafeCell<MaybeUninit<Notified<Arc<Handle>>>>; 256]`
note: required because it appears within the type `PhantomData<[UnsafeCell<MaybeUninit<Notified<Arc<Handle>>>>; 256]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Unique<[UnsafeCell<MaybeUninit<Notified<Arc<Handle>>>>; 256]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/unique.rs:37:12
|
37 | pub struct Unique<T: ?Sized> {
| ^^^^^^
note: required because it appears within the type `Box<[UnsafeCell<MaybeUninit<Notified<Arc<Handle>>>>; 256]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:195:12
|
195 | pub struct Box<
| ^^^
note: required because it appears within the type `Inner<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/queue.rs:36:19
|
36 | pub(crate) struct Inner<T: 'static> {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner<Arc<Handle>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner<Arc<Handle>>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner<Arc<Handle>>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Steal<Arc<Handle>>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/queue.rs:34:19
|
34 | pub(crate) struct Steal<T: 'static>(Arc<Inner<T>>);
| ^^^^^
note: required because it appears within the type `Remote`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:201:8
|
201 | struct Remote {
| ^^^^^^
= note: required because it appears within the type `[Remote]`
note: required because it appears within the type `PhantomData<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Unique<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/unique.rs:37:12
|
37 | pub struct Unique<T: ?Sized> {
| ^^^^^^
note: required because it appears within the type `Box<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:195:12
|
195 | pub struct Box<
| ^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
error[E0277]: the type `UnsafeCell<runtime::driver::Driver>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| _________________------------------------_^
| | |
| | required by a bound introduced by this call
8 | | rt.spawn(my_background_op()); // FAIL TO COMPILE
9 | | tokio::spawn(my_background_op()); // OK
10 | | });
| |_________^ `UnsafeCell<runtime::driver::Driver>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
|
= help: within `Runtime`, the trait `RefUnwindSafe` is not implemented for `UnsafeCell<runtime::driver::Driver>`
note: required because it appears within the type `TryLock<Driver>`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/util/try_lock.rs:8:19
|
8 | pub(crate) struct TryLock<T> {
| ^^^^^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/park.rs:41:8
|
41 | struct Shared {
| ^^^^^^
note: required because it appears within the type `ArcInner<Shared>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Shared>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Shared>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Inner`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/park.rs:21:8
|
21 | struct Inner {
| ^^^^^
note: required because it appears within the type `ArcInner<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Inner>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Inner>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Unparker`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/park.rs:17:19
|
17 | pub(crate) struct Unparker {
| ^^^^^^^^
note: required because it appears within the type `Remote`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:201:8
|
201 | struct Remote {
| ^^^^^^
= note: required because it appears within the type `[Remote]`
note: required because it appears within the type `PhantomData<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Unique<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ptr/unique.rs:37:12
|
37 | pub struct Unique<T: ?Sized> {
| ^^^^^^
note: required because it appears within the type `Box<[Remote]>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/boxed.rs:195:12
|
195 | pub struct Box<
| ^^^
note: required because it appears within the type `Shared`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/worker.rs:147:19
|
147 | pub(crate) struct Shared {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/multi_thread/handle.rs:21:19
|
21 | pub(crate) struct Handle {
| ^^^^^^
note: required because it appears within the type `ArcInner<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:349:8
|
349 | struct ArcInner<T: ?Sized> {
| ^^^^^^^^
note: required because it appears within the type `PhantomData<ArcInner<Handle>>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/marker.rs:789:12
|
789 | pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
note: required because it appears within the type `Arc<Handle>`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/sync.rs:248:12
|
248 | pub struct Arc<
| ^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/scheduler/mod.rs:31:17
|
31 | pub(crate) enum Handle {
| ^^^^^^
note: required because it appears within the type `Handle`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/handle.rs:14:12
|
14 | pub struct Handle {
| ^^^^^^
note: required because it appears within the type `Runtime`
--> /Users/tom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.34.0/src/runtime/runtime.rs:95:12
|
95 | pub struct Runtime {
| ^^^^^^^
= note: required for `&Runtime` to implement `UnwindSafe`
note: required because it's used within this closure
--> src/main.rs:7:42
|
7 | let _ = std::panic::catch_unwind(|| {
| ^^
note: required by a bound in `catch_unwind`
--> /Users/tom/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/panic.rs:141:40
|
141 | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
| ^^^^^^^^^^ required by this bound in `catch_unwind`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `bug` (bin "bug") due to 18 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment