Skip to content

Commit efe3d69

Browse files
committed
fix minor errors
1 parent a4e3f36 commit efe3d69

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/test/ui/issue-47377.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010
// ignore-tidy-tab
1111
fn main() {
12-
let b = "hello";
13-
let _a = b + ", World!";
14-
//~^ ERROR E0369
12+
let b = "hello";
13+
let _a = b + ", World!";
14+
//~^ ERROR E0369
1515
}

src/test/ui/issue-47377.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0369]: binary operation `+` cannot be applied to type `&str`
2-
--> $DIR/issue-47377.rs:13:14
2+
--> $DIR/issue-47377.rs:13:12
33
|
4-
13 | let _a = b + ", World!";
5-
| ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
4+
13 | let _a = b + ", World!";
5+
| ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
66
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
77
|
8-
13 | let _a = b.to_owned() + ", World!";
9-
| ^^^^^^^^^^^^
8+
13 | let _a = b.to_owned() + ", World!";
9+
| ^^^^^^^^^^^^
1010

1111
error: aborting due to previous error
1212

src/test/ui/issue-47380.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
// ignore-tidy-tab
1110
fn main() {
1211
let b = "hello";
1312
println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";

src/test/ui/issue-47380.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0369]: binary operation `+` cannot be applied to type `&str`
2-
--> $DIR/issue-47380.rs:13:33
2+
--> $DIR/issue-47380.rs:12:33
33
|
4-
13 | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
4+
12 | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
55
| ^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
66
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
77
|
8-
13 | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
8+
12 | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
99
| ^^^^^^^^^^^^
1010

1111
error: aborting due to previous error

0 commit comments

Comments
 (0)