glutin icon indicating copy to clipboard operation
glutin copied to clipboard

wasm32-unknown-emscripten target no longer builds

Open codewiz opened this issue 4 years ago • 3 comments

error[E0412]: cannot find type `Rect` in this scope
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/platform_impl/emscripten/mod.rs:152:53
    |
152 |     pub fn swap_buffers_with_damage(&self, rects: &[Rect]) -> Result<(), ContextError> {
    |                                                     ^^^^ not found in this scope
    |
help: consider importing this struct
    |
3   | use crate::Rect;
    |

error[E0277]: `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>` cannot be shared between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |                  ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>` cannot be shared between threads safely
    |
    = help: within `context::Context<context::NotCurrent>`, the trait `Sync` is not implemented for `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `RefCell<&'static str>` cannot be shared between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |                  ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `RefCell<&'static str>` cannot be shared between threads safely
    |
    = help: within `context::Context<context::NotCurrent>`, the trait `Sync` is not implemented for `RefCell<&'static str>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>` cannot be sent between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |           ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>` cannot be sent between threads safely
    |
    = help: within `context::Context<context::NotCurrent>`, the trait `Send` is not implemented for `Rc<RefCell<winit::platform_impl::platform::backend::canvas::Canvas>>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn Fn() + 'static)` cannot be shared between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |                  ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Fn() + 'static)` cannot be shared between threads safely
    |
    = help: the trait `Sync` is not implemented for `(dyn Fn() + 'static)`
    = note: required because of the requirements on the impl of `Sync` for `Unique<(dyn Fn() + 'static)>`
    = note: required because it appears within the type `Box<(dyn Fn() + 'static)>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn Fn(PhysicalSize<u32>) + 'static)` cannot be shared between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |                  ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Fn(PhysicalSize<u32>) + 'static)` cannot be shared between threads safely
    |
    = help: the trait `Sync` is not implemented for `(dyn Fn(PhysicalSize<u32>) + 'static)`
    = note: required because of the requirements on the impl of `Sync` for `Unique<(dyn Fn(PhysicalSize<u32>) + 'static)>`
    = note: required because it appears within the type `Box<(dyn Fn(PhysicalSize<u32>) + 'static)>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn Fn() + 'static)` cannot be sent between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |           ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Fn() + 'static)` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `(dyn Fn() + 'static)`
    = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Fn() + 'static)>`
    = note: required because it appears within the type `Box<(dyn Fn() + 'static)>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn Fn(PhysicalSize<u32>) + 'static)` cannot be sent between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |           ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Fn(PhysicalSize<u32>) + 'static)` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `(dyn Fn(PhysicalSize<u32>) + 'static)`
    = note: required because of the requirements on the impl of `Send` for `Unique<(dyn Fn(PhysicalSize<u32>) + 'static)>`
    = note: required because it appears within the type `Box<(dyn Fn(PhysicalSize<u32>) + 'static)>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn FnOnce() + 'static)` cannot be shared between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |                  ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn FnOnce() + 'static)` cannot be shared between threads safely
    |
    = help: the trait `Sync` is not implemented for `(dyn FnOnce() + 'static)`
    = note: required because of the requirements on the impl of `Sync` for `Unique<(dyn FnOnce() + 'static)>`
    = note: required because it appears within the type `Box<(dyn FnOnce() + 'static)>`
    = note: required because it appears within the type `Option<Box<(dyn FnOnce() + 'static)>>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error[E0277]: `(dyn FnOnce() + 'static)` cannot be sent between threads safely
   --> /home/bernie/.cargo/registry/src/github.com-1ecc6299db9ec823/glutin-0.26.0/src/context.rs:204:6
    |
199 | trait FailToCompileIfNotSendSync
    |       -------------------------- required by a bound in this
200 | where
201 |     Self: Send + Sync,
    |           ---- required by this bound in `FailToCompileIfNotSendSync`
...
204 | impl FailToCompileIfNotSendSync for Context<NotCurrent> {}
    |      ^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn FnOnce() + 'static)` cannot be sent between threads safely
    |
    = help: the trait `Send` is not implemented for `(dyn FnOnce() + 'static)`
    = note: required because of the requirements on the impl of `Send` for `Unique<(dyn FnOnce() + 'static)>`
    = note: required because it appears within the type `Box<(dyn FnOnce() + 'static)>`
    = note: required because it appears within the type `Option<Box<(dyn FnOnce() + 'static)>>`
    = note: required because it appears within the type `winit::platform_impl::platform::window::Window`
    = note: required because it appears within the type `Window`
    = note: required because it appears within the type `platform_impl::platform_impl::Context`
    = note: required because it appears within the type `context::Context<context::NotCurrent>`

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0277, E0412.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `glutin`

codewiz avatar Mar 01 '21 12:03 codewiz

Still broken in glutin 0.27

codewiz avatar Aug 09 '21 12:08 codewiz

Encountering the same issue.

UE2020 avatar Jan 18 '22 02:01 UE2020

Having this issue too on 0.27

zdimension avatar Feb 05 '22 21:02 zdimension

glutin doesn't explicitly support wasm since it doesn't deal with webgl. That might change in the future.

kchibisov avatar Sep 03 '22 06:09 kchibisov