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

Compile error from client #2

Open
eecheng87 opened this issue Oct 29, 2022 · 1 comment
Open

Compile error from client #2

eecheng87 opened this issue Oct 29, 2022 · 1 comment

Comments

@eecheng87
Copy link

Hi, all

Thanks for your great project. I found there are some error message during the build. I use rustc 1.66.0-nightly (9565dfeb4 2022-10-28) and build the project with cargo +nightly build --release. Here is the log:

   Compiling client v0.1.0 (/home/eecheng/monoio-benchmark/client)
   Compiling monoio-server v0.1.0 (/home/eecheng/monoio-benchmark/monoio-server)
error[E0596]: cannot borrow `stream` as mutable, as it is not declared as mutable
  --> monoio-server/src/main.rs:40:34
   |
36 |     while let Ok((stream, _)) = listener.accept().await {
   |                   ------ help: consider changing this to be mutable: `mut stream`
...
40 |                 let (r, buf_r) = stream.read_exact(buf).await;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `stream` as mutable, as it is not declared as mutable
  --> monoio-server/src/main.rs:45:34
   |
36 |     while let Ok((stream, _)) = listener.accept().await {
   |                   ------ help: consider changing this to be mutable: `mut stream`
...
45 |                 let (w, buf_w) = stream.write_all(buf_r).await;
   |                                  ^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0034]: multiple applicable items in scope
  --> monoio-server/src/main.rs:23:18
   |
23 |                 .build()
   |                  ^^^^^ multiple `build` found
   |
   = note: candidate #1 is defined in an impl for the type `RuntimeBuilder<FusionDriver>`
   = note: candidate #2 is defined in an impl for the type `RuntimeBuilder<TimeDriver<FusionDriver>>`
   = note: candidate #3 is defined in an impl for the type `RuntimeBuilder<IoUringDriver>`
   = note: candidate #4 is defined in an impl for the type `RuntimeBuilder<TimeDriver<IoUringDriver>>`
   = note: and 2 others

Some errors have detailed explanations: E0034, E0596.
For more information about an error, try `rustc --explain E0034`.
error: could not compile `monoio-server` due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
error[E0596]: cannot borrow `stream` as mutable, as it is not declared as mutable
   --> client/src/main.rs:123:26
    |
115 |     let stream = TcpStream::connect(target).await.unwrap();
    |         ------ help: consider changing this to be mutable: `mut stream`
...
123 |         let (w, buf_w) = stream.write_all(buf).await;
    |                          ^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0596]: cannot borrow `stream` as mutable, as it is not declared as mutable
   --> client/src/main.rs:129:26
    |
115 |     let stream = TcpStream::connect(target).await.unwrap();
    |         ------ help: consider changing this to be mutable: `mut stream`
...
129 |         let (r, buf_r) = stream.read_exact(buf_w).await;
    |                          ^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable

error[E0034]: multiple applicable items in scope
  --> client/src/main.rs:49:82
   |
49 |             let mut rt = RuntimeBuilder::new().with_entries(2560).enable_timer().build().unwrap();
   |                                                                                  ^^^^^ multiple `build` found
   |
   = note: candidate #1 is defined in an impl for the type `RuntimeBuilder<FusionDriver>`
   = note: candidate #2 is defined in an impl for the type `RuntimeBuilder<TimeDriver<FusionDriver>>`
   = note: candidate #3 is defined in an impl for the type `RuntimeBuilder<IoUringDriver>`
   = note: candidate #4 is defined in an impl for the type `RuntimeBuilder<TimeDriver<IoUringDriver>>`
   = note: and 2 others

error: could not compile `client` due to 3 previous errors
@ihciah
Copy link
Member

ihciah commented Oct 29, 2022

It can be fixed as the help hints. To run it quickly, you can fix it by your own. And if you are will to submit a PR, feel free to submit one.

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

2 participants