Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send impl for tty::windows::Console #160

Closed
hayd opened this issue Nov 3, 2018 · 2 comments
Closed

Send impl for tty::windows::Console #160

hayd opened this issue Nov 3, 2018 · 2 comments

Comments

@hayd
Copy link
Contributor

hayd commented Nov 3, 2018

I am seeing the following error on Windows (but not on osx/linux, these both work), here DenoRepl is a struct containing an Editor<()>.

error[E0277]: `*mut std::ffi::c_void` cannot be sent between threads safely
   --> ../../src\isolate.rs:379:5
    |
379 |     tokio::spawn(task);
    |     ^^^^^^^^^^^^ `*mut std::ffi::c_void` cannot be sent between threads safely
    |
    = help: within `std::collections::HashMap<std::string::String, repl::DenoRepl>`, the trait `std::marker::Send` is not implemented for `*mut std::ffi::c_void`
    = note: required because it appears within the type `rustyline::tty::windows::Console`
    = note: required because it appears within the type `rustyline::Editor<()>`
    = note: required because it appears within the type `repl::DenoRepl`
    = note: required because it appears within the type `(std::string::String, repl::DenoRepl)`
    = note: required because it appears within the type `std::marker::PhantomData<(std::string::String, repl::DenoRepl)>`
    = note: required because it appears within the type `std::collections::hash::table::RawTable<std::string::String, repl::DenoRepl>`
    = note: required because it appears within the type `std::collections::HashMap<std::string::String, repl::DenoRepl>`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::collections::HashMap<std::string::String, repl::DenoRepl>>`
    = note: required because it appears within the type `isolate::IsolateState`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<isolate::IsolateState>`
    = note: required because it appears within the type `[closure@../../src\isolate.rs:375:17: 378:8 state:std::sync::Arc<isolate::IsolateState>, req_id:i32]`
    = note: required because it appears within the type `futures::future::chain::Chain<std::boxed::Box<dyn futures::Future<Error=errors::DenoError, Item=std::boxed::Box<[u8]>> + std::marker::Send>, futures::FutureResult<(), errors::DenoError>, [closure@../../src\isolate.rs:375:17: 378:8 state:std::sync::Arc<isolate::IsolateState>, req_id:i32]>`
    = note: required because it appears within the type `futures::AndThen<std::boxed::Box<dyn futures::Future<Error=errors::DenoError, Item=std::boxed::Box<[u8]>> + std::marker::Send>, std::result::Result<(), errors::DenoError>, [closure@../../src\isolate.rs:375:17: 378:8 state:std::sync::Arc<isolate::IsolateState>, req_id:i32]>`
    = note: required because it appears within the type `futures::MapErr<futures::AndThen<std::boxed::Box<dyn futures::Future<Error=errors::DenoError, Item=std::boxed::Box<[u8]>> + std::marker::Send>, std::result::Result<(), errors::DenoError>, [closure@../../src\isolate.rs:375:17: 378:8 state:std::sync::Arc<isolate::IsolateState>, req_id:i32]>, [closure@../../src\isolate.rs:378:18: 378:24]>`
    = note: required by `tokio::spawn`

https://ci.appveyor.com/project/deno/deno/builds/20021726
I'm not sure why this is. Is it because Console doesn't implement Send?

@hayd
Copy link
Contributor Author

hayd commented Nov 3, 2018

A workaround: piscisaureus/deno@02b8202
Should this be incorporated into rustyline?

@hayd
Copy link
Contributor Author

hayd commented Nov 19, 2018

I think this is fixed by #161.

@hayd hayd closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant