diff --git a/src/test/ui/issue-47377.rs b/src/test/ui/issue-47377.rs index a492b4b5567..f294008cfd0 100644 --- a/src/test/ui/issue-47377.rs +++ b/src/test/ui/issue-47377.rs @@ -9,7 +9,7 @@ // except according to those terms. // ignore-tidy-tab fn main() { - let b = "hello"; - let _a = b + ", World!"; - //~^ ERROR E0369 + let b = "hello"; + let _a = b + ", World!"; + //~^ ERROR E0369 } diff --git a/src/test/ui/issue-47377.stderr b/src/test/ui/issue-47377.stderr index 09640c841b8..13b3ff58697 100644 --- a/src/test/ui/issue-47377.stderr +++ b/src/test/ui/issue-47377.stderr @@ -1,12 +1,12 @@ error[E0369]: binary operation `+` cannot be applied to type `&str` - --> $DIR/issue-47377.rs:13:14 + --> $DIR/issue-47377.rs:13:12 | -13 | let _a = b + ", World!"; - | ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings +13 | let _a = b + ", World!"; + | ^^^^^^^^^^^^^^ `+` 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 | -13 | let _a = b.to_owned() + ", World!"; - | ^^^^^^^^^^^^ +13 | let _a = b.to_owned() + ", World!"; + | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/issue-47380.rs b/src/test/ui/issue-47380.rs index 88d4faedb7a..e43a967253c 100644 --- a/src/test/ui/issue-47380.rs +++ b/src/test/ui/issue-47380.rs @@ -7,7 +7,6 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-tidy-tab fn main() { let b = "hello"; println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!"; diff --git a/src/test/ui/issue-47380.stderr b/src/test/ui/issue-47380.stderr index e220b4551e7..6c9f79b5a94 100644 --- a/src/test/ui/issue-47380.stderr +++ b/src/test/ui/issue-47380.stderr @@ -1,11 +1,11 @@ error[E0369]: binary operation `+` cannot be applied to type `&str` - --> $DIR/issue-47380.rs:13:33 + --> $DIR/issue-47380.rs:12:33 | -13 | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!"; +12 | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!"; | ^^^^^^^^^^^^^^ `+` 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 | -13 | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!"; +12 | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!"; | ^^^^^^^^^^^^ error: aborting due to previous error