2022-03-01 05:11:42 -06:00
|
|
|
error[E0382]: use of moved value: `t`
|
|
|
|
--> $DIR/use_of_moved_value_clone_suggestions.rs:3:9
|
|
|
|
|
|
|
|
|
LL | fn duplicate_rc<T>(t: std::rc::Rc<T>) -> (std::rc::Rc<T>, std::rc::Rc<T>) {
|
|
|
|
| - move occurs because `t` has type `Rc<T>`, which does not implement the `Copy` trait
|
|
|
|
LL | (t, t)
|
|
|
|
| - ^ value used here after move
|
|
|
|
| |
|
|
|
|
| value moved here
|
2022-11-02 23:22:24 -05:00
|
|
|
|
|
2023-08-04 12:50:12 -05:00
|
|
|
help: clone the value to increment its reference count
|
2022-11-02 23:22:24 -05:00
|
|
|
|
|
|
|
|
LL | (t.clone(), t)
|
|
|
|
| ++++++++
|
2022-03-01 05:11:42 -06:00
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2022-03-01 05:11:42 -06:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|