Skip to content

can not compile cubestoreΒ #9483

@oldoldman

Description

@oldoldman

Hi guys,
When compiling cubestore(v1.2.32) , I got the following error

error: async closure does not implement `Fn` because it captures state from its environment
    --> cubestore\src\metastore\mod.rs:1431:17
     |
1429 |             .process(
     |              ------- required by a bound introduced by this call
1430 |                 self.clone(),
1431 |                 async move |_| Ok(Delay::new(Duration::from_secs(upload_interval)).await),
     |                 ^^^^^^^^^^^^^^
     |
note: required by a bound in `WorkerLoop::process`
    --> cubestore\src\util\mod.rs:44:24
     |
41   |     pub async fn process<WFR, S, F, FR>(
     |                  ------- required by a bound in this associated function
...
44   |         wait_for: impl Fn(Arc<S>) -> F + Send + Sync + 'static,
     |                        ^^^^^^^^^^^^^^^ required by this bound in `WorkerLoop::process`

and this error

error[E0282]: type annotations needed
  --> cubestore\src\metastore\listener.rs:96:46
   |
96 |             .extract_if(|(_, wait_fn):(_,_)| wait_fn(event.clone()))
   |                                              ^^^^^^^^^^^^^^^^^^^^^^ cannot infer type

error[E0061]: this method takes 2 arguments but 1 argument was supplied
  --> cubestore\src\metastore\listener.rs:96:14
   |
96 |             .extract_if(|(_, wait_fn):(_,_)| wait_fn(event.clone()))
   |              ^^^^^^^^^^--------------------------------------------- argument #2 is missing
   |
note: method defined here
  --> /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb\library\alloc\src\vec\mod.rs:3707:12
help: provide the argument
   |
96 -             .extract_if(|(_, wait_fn):(_,_)| wait_fn(event.clone()))
96 +             .extract_if(|(_, wait_fn):(_,_)| wait_fn(event.clone()), /* filter */)

I'm using rustc 1.86.0 , does this matter?

Metadata

Metadata

Assignees

Labels

questionThe issue is a question. Please use Stack Overflow for questions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions