Guest User

Untitled

a guest
Jul 19th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. let x = 0; if (x=1)==() { true } else { false }
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. warning: variable `x` is assigned to, but never used
  11. --> src/main.rs:5:13
  12. |
  13. 5 | let x = 0; if (x=1)==() { true } else { false }
  14. | ^
  15. |
  16. = note: #[warn(unused_variables)] on by default
  17. = note: consider using `_x` instead
  18.  
  19. warning: value assigned to `x` is never read
  20. --> src/main.rs:5:24
  21. |
  22. 5 | let x = 0; if (x=1)==() { true } else { false }
  23. | ^
  24. |
  25. = note: #[warn(unused_assignments)] on by default
  26.  
  27. error[E0384]: cannot assign twice to immutable variable `x`
  28. --> src/main.rs:5:23
  29. |
  30. 5 | let x = 0; if (x=1)==() { true } else { false }
  31. | - ^^^^^ cannot assign twice to immutable variable
  32. | |
  33. | first assignment to `x`
  34.  
  35. error: aborting due to previous error
  36.  
  37. For more information about this error, try `rustc --explain E0384`.
  38. error: Could not compile `playground`.
  39.  
  40. To learn more, run the command again with --verbose.
  41.  
  42. */
  43.  
  44. /* ~~~~=== stdout ===~~~~
  45.  
  46. */
Add Comment
Please, Sign In to add comment