diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-06-26 15:47:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-26 15:47:16 +0200 |
| commit | aa8ba54caff4c05abaf9bcceece1ffa644fdf2dc (patch) | |
| tree | ce20cce856299a0926651037ef2715d307c361e6 /tests/codegen/src-hash-algorithm | |
| parent | 8f21a5c92ea55c348c275a1bc4fedbdf181e0d64 (diff) | |
| parent | 904652b2d05d967deadf201fc35e8343a822c7a6 (diff) | |
| download | rust-aa8ba54caff4c05abaf9bcceece1ffa644fdf2dc.tar.gz rust-aa8ba54caff4c05abaf9bcceece1ffa644fdf2dc.zip | |
Rollup merge of #124595 - estebank:issue-104232, r=davidtwco
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);
|
```
Fix rust-lang/rust#104232.
Diffstat (limited to 'tests/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
