Skip to content

Commit

Permalink
chore: Update rust version to fix complie error
Browse files Browse the repository at this point in the history
a following error happens if we use v1.71.0 to compile:
error[E0659]: `cbc` is ambiguous
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:26:5
   |
26 | use cbc::CbcWrapper;
   |     ^^^ ambiguous name
   |
   = note: ambiguous because of multiple potential import sources
   = note: `cbc` could refer to a crate passed with `--extern`
   = help: use `::cbc` to refer to this crate unambiguously
note: `cbc` could also refer to the module defined here
  --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:38:1
   |
38 | pub(crate) mod cbc;
   | ^^^^^^^^^^^^^^^^^^^
   = help: use `self::cbc` to refer to this module unambiguously

error: future cannot be sent between threads safely
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/server/mod.rs:683:29
    |
683 |     let join = tokio::spawn(session.run(stream, handler));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `run` is not `Send`
    |
    = help: the trait `for<'a> std::marker::Sync` is not implemented for `(dyn cipher::OpeningKey + std::marker::Send + 'a)`
note: future is not `Send` as this value is used across an await
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:265:10
    |
264 |         .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..])
    |                                        ------ has type `&(dyn cipher::OpeningKey + std::marker::Send + 'a)` which is not `Send`
265 |         .await?;
    |          ^^^^^ - `cipher` is later dropped here
    |          |
    |          await occurs here, with `cipher` maybe used later
help: consider moving this into a `let` binding to create a shorter lived borrow
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:264:40
    |
264 |         .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..])
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `tokio::spawn`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.39.2/src/task/spawn.rs:167:21
    |
165 |     pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
    |            ----- required by a bound in this function
166 |     where
167 |         F: Future + Send + 'static,
    |                     ^^^^ required by this bound in `spawn`

error: future cannot be sent between threads safely
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/client/mod.rs:723:29
    |
723 |     let join = tokio::spawn(session.run(stream, handler, Some(encrypted_signal)));
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `run` is not `Send`
    |
    = help: the trait `for<'a> std::marker::Sync` is not implemented for `(dyn cipher::OpeningKey + std::marker::Send + 'a)`
note: future is not `Send` as this value is used across an await
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:265:10
    |
264 |         .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..])
    |                                        ------ has type `&(dyn cipher::OpeningKey + std::marker::Send + 'a)` which is not `Send`
265 |         .await?;
    |          ^^^^^ - `cipher` is later dropped here
    |          |
    |          await occurs here, with `cipher` maybe used later
help: consider moving this into a `let` binding to create a shorter lived borrow
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/russh-0.45.0/src/cipher/mod.rs:264:40
    |
264 |         .read_exact(&mut buffer.buffer[cipher.packet_length_to_read_for_block_length()..])
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `tokio::spawn`
   --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.39.2/src/task/spawn.rs:167:21
    |
165 |     pub fn spawn<F>(future: F) -> JoinHandle<F::Output>
    |            ----- required by a bound in this function
166 |     where
167 |         F: Future + Send + 'static,
    |                     ^^^^ required by this bound in `spawn`

For more information about this error, try `rustc --explain E0659`.
error: could not compile `russh` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
  • Loading branch information
Miyoshi-Ryota committed Aug 17, 2024
1 parent e185b8c commit 97044dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/async-ssh2-tokio/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.71.0
FROM rust:1.80.0

ENV ASYNC_SSH2_TEST_HOST_IP=10.10.10.2
ENV ASYNC_SSH2_TEST_HOST_USER=root
Expand Down

0 comments on commit 97044dc

Please sign in to comment.