Guest User

Untitled

a guest
May 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. String::from("call") + (0..10).map(|_| " ret")
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0308]: mismatched types
  11. --> src/main.rs:5:32
  12. |
  13. 5 | String::from("call") + (0..10).map(|_| " ret")
  14. | ^^^^^^^^^^^^^^^^^^^^^^^ expected &str, found struct `std::iter::Map`
  15. |
  16. = note: expected type `&str`
  17. found type `std::iter::Map<std::ops::Range<{integer}>, [closure@src/main.rs:5:44: 5:54]>`
  18.  
  19. error: aborting due to previous error
  20.  
  21. For more information about this error, try `rustc --explain E0308`.
  22. error: Could not compile `playground`.
  23.  
  24. To learn more, run the command again with --verbose.
  25.  
  26. */
  27.  
  28. /* ~~~~=== stdout ===~~~~
  29.  
  30. */
Add Comment
Please, Sign In to add comment