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

Can you run this app now? #16

Closed
nanqic opened this issue Jul 8, 2022 · 3 comments
Closed

Can you run this app now? #16

nanqic opened this issue Jul 8, 2022 · 3 comments

Comments

@nanqic
Copy link

nanqic commented Jul 8, 2022

Hello, I'm a newer for rust. I tried to run this app following by the guide, but got some error below.

Compiling seed v0.5.1
error[E0283]: type annotations needed for Closure<T>
--> C:\Users\Heney.cargo\registry\src\github.com-1ecc6299db9ec823\seed-0.5.1\src\browser\service\routing.rs:113:19
|
113 | let closure = Closure::new(move |event: web_sys::Event| {
| ------- ^^^^^^^^^^^^ cannot infer type for type parameter T
| |
| consider giving closure the explicit type Closure<T>, where the type parameter T is specified
|
= note: cannot satisfy _: WasmClosure
note: required by a bound in Closure::<T>::new
--> C:\Users\Heney.cargo\registry\src\github.com-1ecc6299db9ec823\wasm-bindgen-0.2.81\src\closure.rs:251:17
|
251 | T: ?Sized + WasmClosure,
| ^^^^^^^^^^^ required by this bound in Closure::<T>::new
help: consider specifying the type argument in the function call
|
113 | let closure = Closure::new::(move |event: web_sys::Event| {
| +++++

error[E0283]: type annotations needed for Closure<T>
--> C:\Users\Heney.cargo\registry\src\github.com-1ecc6299db9ec823\seed-0.5.1\src\browser\service\routing.rs:113:19
|
113 | let closure = Closure::new(move |event: web_sys::Event| {
| ------- ^^^^^^^^^^^^ cannot infer type for type parameter T
| |
| consider giving closure the explicit type Closure<T>, where the type parameter T is specified
|
= note: multiple impls satisfying [closure@C:\Users\Heney\.cargo\registry\src\github.com-1ecc6299db9ec823\seed-0.5.1\src\browser\service\routing.rs:113:32: 150:6]: IntoWasmClosure<_> found in the wasm_bindgen crate:
- impl<T, A, R> IntoWasmClosure<(dyn Fn(A) -> R + 'static)> for T
where <T as FnOnce<(A,)>>::Output == R, T: 'static, T: Fn<(A,)>, A: 'static, A: FromWasmAbi, R: 'static, R: ReturnWasmAbi;
- impl<T, A, R> IntoWasmClosure<(dyn FnMut(A) -> R + 'static)> for T
where <T as FnOnce<(A,)>>::Output == R, T: 'static, T: FnMut<(A,)>, A: 'static, A: FromWasmAbi, R: 'static, R: ReturnWasmAbi;
note: required by a bound in Closure::<T>::new
--> C:\Users\Heney.cargo\registry\src\github.com-1ecc6299db9ec823\wasm-bindgen-0.2.81\src\closure.rs:271:12
|
271 | F: IntoWasmClosure + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in Closure::<T>::new
help: consider specifying the type argument in the function call
|
113 | let closure = Closure::new::(move |event: web_sys::Event| {
| +++++

For more information about this error, try rustc --explain E0283.
error: could not compile seed due to 2 previous errors
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.

OS: Windows11
rust: latest

Can you please help me run this app? Thanks.

@MartinKavik
Copy link
Member

Hi @nanqic, this project is outdated, I would suggest to look at:

@nanqic
Copy link
Author

nanqic commented Jul 11, 2022

Okey, thank you for your suggest!

@nanqic nanqic closed this as completed Jul 11, 2022
@dfwilbanks395
Copy link

Hey @nanqic - I ran into this as well, and it can be resolved by changing Closure::new( .. ) in routing.rs line 113 to <Closure<_> as ClosureNew<_>>::new( .. ).

Seems related to seed-rs/seed#698, though I'm not sure why that's an issue here.

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

3 participants