Advertisement
sword_smith

Borrow checker problems

Feb 23rd, 2023
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. Current compiler error:
  2.  
  3. ```
  4. error[E0507]: cannot move out of a shared reference
  5. --> triton-vm/src/table/constraint_circuit.rs:1037:19
  6. |
  7. 1037 | match &node.circuit.as_ref().borrow_mut().expression {
  8. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  9. 1038 | BinaryOperation(_, mut lhs, mut rhs) => {
  10. | ------- ------- ...and here
  11. | |
  12. | data moved here
  13. |
  14. = note: move occurs because these variables have types that don't implement the `Copy` trait
  15.  
  16.  
  17. ```
  18.  
  19. If I remove the ampersand:
  20. ```
  21. error[E0507]: cannot move out of dereference of `RefMut<'_, constraint_circuit::ConstraintCircuit<II>>`
  22. --> triton-vm/src/table/constraint_circuit.rs:1037:19
  23. |
  24. 1037 | match node.circuit.as_ref().borrow_mut().expression {
  25. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider borrowing here: `&node.circuit.as_ref().borrow_mut().expression`
  26. 1038 | BinaryOperation(_, mut lhs, mut rhs) => {
  27. | ------- ------- ...and here
  28. | |
  29. | data moved here
  30. |
  31. = note: move occurs because these variables have types that don't implement the `Copy` trait
  32. ```
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement