Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- "{}" + "foo"
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0369]: binary operation `+` cannot be applied to type `&str`
- --> src/main.rs:5:9
- |
- 5 | "{}" + "foo"
- | ^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
- 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
- |
- 5 | "{}".to_owned() + "foo"
- | ^^^^^^^^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0369`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment