pijul_org / pijul

#401 Undefined behavior warning in the latest thrussh build

Opened by berkus, on May 23, 2019
Closed
berkus commented on May 23, 2019
warning[E0382]: assign to part of moved value: `newkeys`\r                                                                              +
   --> /Users/skarchebnyy/.cargo/registry/src/github.com-1ecc6299db9ec823/thrussh-0.20.7/src/client/connection.rs:550:13\r              +
    |\r                                                                                                                                 +
539 |             let mut newkeys = kexdhdone.compute_keys(\r                                                                           +
    |                 ----------- move occurs because `newkeys` has type `session::NewKeys`, which does not implement the `Copy` trait\r+
...\r                                                                                                                                   +
549 |             session.0.kex = Some(Kex::NewKeys(newkeys));\r                                                                        +
    |                                               ------- value moved here\r                                                          +
550 |             newkeys.sent = true;\r                                                                                                +
    |             ^^^^^^^^^^^^^^^^^^^ value partially assigned here after move\r                                                        +
    |\r                                                                                                                                 +
    = warning: this error has been downgraded to a warning for backwards compatibility with previous releases\r                         +
    = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future\r      +
pmeunier commented on May 23, 2019

Thanks, but that error belongs in the Thrussh repository, not here. I've just fixed it there.