You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/test/ui/issues/issue-47377.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0369]: binary operation `+` cannot be applied to type `&str`
4
4
LL | let _a = b + ", World!";
5
5
| - ^ ---------- &str
6
6
| | |
7
-
| | `+` can't be used to concatenate two `&str` strings
7
+
| | `+` cannot be used to concatenate two `&str` strings
8
8
| &str
9
9
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
Copy file name to clipboardExpand all lines: src/test/ui/issues/issue-47380.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0369]: binary operation `+` cannot be applied to type `&str`
4
4
LL | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
5
5
| - ^ ---------- &str
6
6
| | |
7
-
| | `+` can't be used to concatenate two `&str` strings
7
+
| | `+` cannot be used to concatenate two `&str` strings
8
8
| &str
9
9
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
Copy file name to clipboardExpand all lines: src/test/ui/span/issue-39018.stderr
+143-7
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ error[E0369]: binary operation `+` cannot be applied to type `&str`
4
4
LL | let x = "Hello " + "World!";
5
5
| -------- ^ -------- &str
6
6
| | |
7
-
| | `+` can't be used to concatenate two `&str` strings
7
+
| | `+` cannot be used to concatenate two `&str` strings
8
8
| &str
9
9
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
10
10
|
@@ -25,16 +25,152 @@ error[E0369]: binary operation `+` cannot be applied to type `&str`
| | `+` cannot be used to concatenate a `&str` with a `String`
31
31
| &str
32
-
| `+` can't be used to concatenate a `&str` with a `String`
33
32
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
34
33
|
35
34
LL | let x = "Hello ".to_owned() + &"World!".to_owned();
36
35
| ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
37
36
38
-
error: aborting due to 3 previous errors
37
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
38
+
--> $DIR/issue-39018.rs:26:16
39
+
|
40
+
LL | let _ = &a + &b;
41
+
| -- ^ -- &std::string::String
42
+
| | |
43
+
| | `+` cannot be used to concatenate two `&str` strings
44
+
| &std::string::String
45
+
help: 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
46
+
|
47
+
LL | let _ = a + &b;
48
+
| ^
49
+
50
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
51
+
--> $DIR/issue-39018.rs:27:16
52
+
|
53
+
LL | let _ = &a + b;
54
+
| -- ^ - std::string::String
55
+
| | |
56
+
| | `+` cannot be used to concatenate a `&str` with a `String`
57
+
| &std::string::String
58
+
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
59
+
|
60
+
LL | let _ = a + &b;
61
+
| ^ ^^
62
+
63
+
error[E0308]: mismatched types
64
+
--> $DIR/issue-39018.rs:29:17
65
+
|
66
+
LL | let _ = a + b;
67
+
| ^
68
+
| |
69
+
| expected &str, found struct `std::string::String`
70
+
| help: consider borrowing here: `&b`
71
+
|
72
+
= note: expected type `&str`
73
+
found type `std::string::String`
74
+
75
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
76
+
--> $DIR/issue-39018.rs:30:15
77
+
|
78
+
LL | let _ = e + b;
79
+
| - ^ - std::string::String
80
+
| | |
81
+
| | `+` cannot be used to concatenate a `&str` with a `String`
82
+
| &std::string::String
83
+
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
84
+
|
85
+
LL | let _ = e.to_owned() + &b;
86
+
| ^^^^^^^^^^^^ ^^
87
+
88
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
89
+
--> $DIR/issue-39018.rs:31:15
90
+
|
91
+
LL | let _ = e + &b;
92
+
| - ^ -- &std::string::String
93
+
| | |
94
+
| | `+` cannot be used to concatenate two `&str` strings
95
+
| &std::string::String
96
+
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
97
+
|
98
+
LL | let _ = e.to_owned() + &b;
99
+
| ^^^^^^^^^^^^
100
+
101
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
102
+
--> $DIR/issue-39018.rs:32:15
103
+
|
104
+
LL | let _ = e + d;
105
+
| - ^ - &str
106
+
| | |
107
+
| | `+` cannot be used to concatenate two `&str` strings
108
+
| &std::string::String
109
+
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
110
+
|
111
+
LL | let _ = e.to_owned() + d;
112
+
| ^^^^^^^^^^^^
113
+
114
+
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
115
+
--> $DIR/issue-39018.rs:33:15
116
+
|
117
+
LL | let _ = e + &d;
118
+
| - ^ -- &&str
119
+
| | |
120
+
| | `+` cannot be used to concatenate two `&str` strings
121
+
| &std::string::String
122
+
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
123
+
|
124
+
LL | let _ = e.to_owned() + &d;
125
+
| ^^^^^^^^^^^^
126
+
127
+
error[E0369]: binary operation `+` cannot be applied to type `&&str`
128
+
--> $DIR/issue-39018.rs:34:16
129
+
|
130
+
LL | let _ = &c + &d;
131
+
| -- ^ -- &&str
132
+
| |
133
+
| &&str
134
+
|
135
+
= note: an implementation of `std::ops::Add` might be missing for `&&str`
136
+
137
+
error[E0369]: binary operation `+` cannot be applied to type `&&str`
138
+
--> $DIR/issue-39018.rs:35:16
139
+
|
140
+
LL | let _ = &c + d;
141
+
| -- ^ - &str
142
+
| |
143
+
| &&str
144
+
|
145
+
= note: an implementation of `std::ops::Add` might be missing for `&&str`
146
+
147
+
error[E0369]: binary operation `+` cannot be applied to type `&str`
148
+
--> $DIR/issue-39018.rs:36:15
149
+
|
150
+
LL | let _ = c + &d;
151
+
| - ^ -- &&str
152
+
| | |
153
+
| | `+` cannot be used to concatenate two `&str` strings
154
+
| &str
155
+
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
156
+
|
157
+
LL | let _ = c.to_owned() + &d;
158
+
| ^^^^^^^^^^^^
159
+
160
+
error[E0369]: binary operation `+` cannot be applied to type `&str`
161
+
--> $DIR/issue-39018.rs:37:15
162
+
|
163
+
LL | let _ = c + d;
164
+
| - ^ - &str
165
+
| | |
166
+
| | `+` cannot be used to concatenate two `&str` strings
167
+
| &str
168
+
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
169
+
|
170
+
LL | let _ = c.to_owned() + d;
171
+
| ^^^^^^^^^^^^
172
+
173
+
error: aborting due to 14 previous errors
39
174
40
-
For more information about this error, try `rustc --explain E0369`.
175
+
Some errors have detailed explanations: E0308, E0369.
176
+
For more information about an error, try `rustc --explain E0308`.
Copy file name to clipboardExpand all lines: src/test/ui/str/str-concat-on-double-ref.stderr
+5-2
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,13 @@ error[E0369]: binary operation `+` cannot be applied to type `&std::string::Stri
3
3
|
4
4
LL | let c = a + b;
5
5
| - ^ - &str
6
-
| |
6
+
| | |
7
+
| | `+` cannot be used to concatenate two `&str` strings
7
8
| &std::string::String
9
+
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
8
10
|
9
-
= note: an implementation of `std::ops::Add` might be missing for `&std::string::String`
0 commit comments