Skip to content

Reactor is not RefUnwindSafe #285

Open
@Marwes

Description

@Marwes

Specifically this is because of the use of a UnsafeCell inside a long list of types so I am not sure which part exactly needs to implement this (guessing it is the Queue that would assert that it is safe?).

error[E0277]: the trait bound `std::cell::UnsafeCell<*mut futures::sync::mpsc::queue::Node<std::option::Option<tokio_core::reactor::Message>>>: std::panic::RefUnwindSafe` is not satisfied in `gluon::Thread`
  --> tests\main.rs:91:9
   |
91 |         tensile::test(name.clone(), move || -> Result<(), String> {
   |         ^^^^^^^^^^^^^ the type std::cell::UnsafeCell<*mut futures::sync::mpsc::queue::Node<std::option::Option<tokio_core::reactor::Message>>> may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
   |
   = help: within `gluon::Thread`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<*mut futures::sync::mpsc::queue::Node<std::option::Option<tokio_core::reactor::Message>>>`
   = note: required because it appears within the type `futures::sync::mpsc::queue::Queue<std::option::Option<tokio_core::reactor::Message>>`
   = note: required because it appears within the type `futures::sync::mpsc::Inner<tokio_core::reactor::Message>`
   = note: required because it appears within the type `alloc::arc::ArcInner<futures::sync::mpsc::Inner<tokio_core::reactor::Message>>`
   = note: required because it appears within the type `std::marker::PhantomData<alloc::arc::ArcInner<futures::sync::mpsc::Inner<tokio_core::reactor::Message>>>`
   = note: required because it appears within the type `std::ptr::Shared<alloc::arc::ArcInner<futures::sync::mpsc::Inner<tokio_core::reactor::Message>>>`
   = note: required because it appears within the type `std::sync::Arc<futures::sync::mpsc::Inner<tokio_core::reactor::Message>>`
   = note: required because it appears within the type `futures::sync::mpsc::Sender<tokio_core::reactor::Message>`
   = note: required because it appears within the type `futures::sync::mpsc::UnboundedSender<tokio_core::reactor::Message>`
   = note: required because it appears within the type `tokio_core::reactor::Remote`
   = note: required because it appears within the type `std::option::Option<tokio_core::reactor::Remote>`
   = note: required because it appears within the type `gluon::<unnamed>::vm::GlobalVmState`
   = note: required because it appears within the type `alloc::arc::ArcInner<gluon::<unnamed>::vm::GlobalVmState>`
   = note: required because it appears within the type `std::marker::PhantomData<alloc::arc::ArcInner<gluon::<unnamed>::vm::GlobalVmState>>`
   = note: required because it appears within the type `std::ptr::Shared<alloc::arc::ArcInner<gluon::<unnamed>::vm::GlobalVmState>>`
   = note: required because it appears within the type `std::sync::Arc<gluon::<unnamed>::vm::GlobalVmState>`
   = note: required because it appears within the type `gluon::Thread`
   = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*const gluon::Thread`
   = note: required because it appears within the type `gluon::<unnamed>::gc::GcPtr<gluon::Thread>`
   = note: required because it appears within the type `gluon::RootedThread`
   = note: required because it appears within the type `[closure@tests\main.rs:91:37: 93:10 vm:gluon::RootedThread, name:std::string::String, filename:std::path::PathBuf]`
   = note: required because of the requirements on the impl of `tensile::Testable` for `[closure@tests\main.rs:91:37: 93:10 vm:gluon::RootedThread, name:std::string::String, filename:std::path::PathBuf]`
   = note: required by `tensile::test`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions