Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. #![allow(unreachable_code)]
  2.  
  3.  
  4. fn main() {
  5. println!("{:?}", {
  6. let str = String::new(); let split = str.split(' '); let (a, b, c) = (split.next(), split.next(), split.next()); format!("{:?}", (a, b, c));
  7. });
  8. }
  9.  
  10.  
  11. /* ~~~~=== stderr ===~~~~
  12. Compiling playground v0.0.1 (/playground)
  13. error[E0596]: cannot borrow `split` as mutable, as it is not declared as mutable
  14. --> src/main.rs:6:79
  15. |
  16. 6 | let str = String::new(); let split = str.split(' '); let (a, b, c) = (split.next(), split.next(), split.next()); format!("{:?}", (a, b, c));
  17. | ----- ^^^^^ cannot borrow as mutable
  18. | |
  19. | help: consider changing this to be mutable: `mut split`
  20.  
  21. error[E0596]: cannot borrow `split` as mutable, as it is not declared as mutable
  22. --> src/main.rs:6:93
  23. |
  24. 6 | let str = String::new(); let split = str.split(' '); let (a, b, c) = (split.next(), split.next(), split.next()); format!("{:?}", (a, b, c));
  25. | ----- ^^^^^ cannot borrow as mutable
  26. | |
  27. | help: consider changing this to be mutable: `mut split`
  28.  
  29. error[E0596]: cannot borrow `split` as mutable, as it is not declared as mutable
  30. --> src/main.rs:6:107
  31. |
  32. 6 | let str = String::new(); let split = str.split(' '); let (a, b, c) = (split.next(), split.next(), split.next()); format!("{:?}", (a, b, c));
  33. | ----- help: consider changing this to be mutable: `mut split` ^^^^^ cannot borrow as mutable
  34.  
  35. error: aborting due to 3 previous errors
  36.  
  37. For more information about this error, try `rustc --explain E0596`.
  38. error: Could not compile `playground`.
  39.  
  40. To learn more, run the command again with --verbose.
  41.  
  42. */
  43.  
  44. /* ~~~~=== stdout ===~~~~
  45.  
  46. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement