Skip to content

Comments

Fix use after move error introduced in new Rust version#10

Merged
alexcrichton merged 2 commits intorustls:masterfrom
timvisee:fix-use-after-move
Oct 11, 2018
Merged

Fix use after move error introduced in new Rust version#10
alexcrichton merged 2 commits intorustls:masterfrom
timvisee:fix-use-after-move

Conversation

@timvisee
Copy link
Contributor

Apparently, the following two use-after-move problems were introduced when compiling with newer Rust versions:

error[E0382]: use of partially moved value: `cert_file`
  --> src/lib.rs:68:5
   |
52 |         Some(path) => put(ENV_CERT_FILE, path),
   |              ---- value moved here
...
68 |     cert_file.is_some() || cert_dir.is_some()
   |     ^^^^^^^^^ value used here after move
   |
   = note: move occurs because the value has type `std::path::PathBuf`, which does not implement the `Copy` trait

error[E0382]: use of partially moved value: `cert_dir`
  --> src/lib.rs:68:28
   |
56 |         Some(path) => put(ENV_CERT_DIR, path),
   |              ---- value moved here
...
68 |     cert_file.is_some() || cert_dir.is_some()
   |                            ^^^^^^^^ value used here after move
   |
   = note: move occurs because the value has type `std::path::PathBuf`, which does not implement the `Copy` trait

This PR fixes these issues.

@alexcrichton alexcrichton merged commit a014ef5 into rustls:master Oct 11, 2018
@alexcrichton
Copy link
Collaborator

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants