about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-05-01 20:46:06 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-06-24 18:44:41 +0000
commit904652b2d05d967deadf201fc35e8343a822c7a6 (patch)
treee65168be3671177481e56d53511ed50b8fc3d6c4 /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent36b21637e93b038453924d3c66821089e71d8baa (diff)
downloadrust-904652b2d05d967deadf201fc35e8343a822c7a6.tar.gz
rust-904652b2d05d967deadf201fc35e8343a822c7a6.zip
Suggest cloning `Arc` moved into closure
```
error[E0382]: borrow of moved value: `x`
  --> $DIR/moves-based-on-type-capture-clause-bad.rs:9:20
   |
LL |     let x = "Hello world!".to_string();
   |         - move occurs because `x` has type `String`, which does not implement the `Copy` trait
LL |     thread::spawn(move || {
   |                   ------- value moved into closure here
LL |         println!("{}", x);
   |                        - variable moved due to use in closure
LL |     });
LL |     println!("{}", x);
   |                    ^ value borrowed here after move
   |
   = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider cloning the value before moving it into the closure
   |
LL ~     let value = x.clone();
LL ~     thread::spawn(move || {
LL ~         println!("{}", value);
   |
```
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions