You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 typeClosure<T>
, where the type parameterT
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 typeClosure<T>
, where the type parameterT
is specified|
= note: multiple
impl
s 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 thewasm_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.
The text was updated successfully, but these errors were encountered: