Guest User

Untitled

a guest
May 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. "{}" + "foo"
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0369]: binary operation `+` cannot be applied to type `&str`
  11. --> src/main.rs:5:9
  12. |
  13. 5 | "{}" + "foo"
  14. | ^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
  15. help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
  16. |
  17. 5 | "{}".to_owned() + "foo"
  18. | ^^^^^^^^^^^^^^^
  19.  
  20. error: aborting due to previous error
  21.  
  22. For more information about this error, try `rustc --explain E0369`.
  23. error: Could not compile `playground`.
  24.  
  25. To learn more, run the command again with --verbose.
  26.  
  27. */
  28.  
  29. /* ~~~~=== stdout ===~~~~
  30.  
  31. */
Add Comment
Please, Sign In to add comment