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
Auto merge of #147143 - estebank:verbose-ret-type, r=fee1-dead
Make replacement suggestion `_` in type verbose
```
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/in-signature.rs:6:21
|
LL | fn arr_fn() -> [u8; _] {
| ^ not allowed in type signatures
|
help: replace with the correct return type
|
LL - fn arr_fn() -> [u8; _] {
LL + fn arr_fn() -> [u8; 3] {
|
```
Copy file name to clipboardExpand all lines: tests/ui/fn/issue-80179.stderr
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,21 +2,26 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
2
2
--> $DIR/issue-80179.rs:10:24
3
3
|
4
4
LL | fn returns_fn_ptr() -> _ {
5
-
| ^
6
-
| |
7
-
| not allowed in type signatures
8
-
| help: replace with the correct return type: `fn() -> i32`
5
+
| ^ not allowed in type signatures
6
+
|
7
+
help: replace with the correct return type
8
+
|
9
+
LL - fn returns_fn_ptr() -> _ {
10
+
LL + fn returns_fn_ptr() -> fn() -> i32 {
11
+
|
9
12
10
13
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
11
14
--> $DIR/issue-80179.rs:18:25
12
15
|
13
16
LL | fn returns_closure() -> _ {
14
-
| ^
15
-
| |
16
-
| not allowed in type signatures
17
-
| help: replace with an appropriate return type: `impl Fn() -> i32`
17
+
| ^ not allowed in type signatures
18
18
|
19
19
= note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
Copy file name to clipboardExpand all lines: tests/ui/fn/suggest-return-closure.stderr
+18-12Lines changed: 18 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,34 +2,40 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures
2
2
--> $DIR/suggest-return-closure.rs:1:17
3
3
|
4
4
LL | fn fn_once() -> _ {
5
-
| ^
6
-
| |
7
-
| not allowed in type signatures
8
-
| help: replace with an appropriate return type: `impl FnOnce()`
5
+
| ^ not allowed in type signatures
9
6
|
10
7
= note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
8
+
help: replace with an appropriate return type
9
+
|
10
+
LL - fn fn_once() -> _ {
11
+
LL + fn fn_once() -> impl FnOnce() {
12
+
|
11
13
12
14
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
13
15
--> $DIR/suggest-return-closure.rs:13:16
14
16
|
15
17
LL | fn fn_mut() -> _ {
16
-
| ^
17
-
| |
18
-
| not allowed in type signatures
19
-
| help: replace with an appropriate return type: `impl FnMut(char)`
18
+
| ^ not allowed in type signatures
20
19
|
21
20
= note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
21
+
help: replace with an appropriate return type
22
+
|
23
+
LL - fn fn_mut() -> _ {
24
+
LL + fn fn_mut() -> impl FnMut(char) {
25
+
|
22
26
23
27
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
24
28
--> $DIR/suggest-return-closure.rs:33:13
25
29
|
26
30
LL | fn fun() -> _ {
27
-
| ^
28
-
| |
29
-
| not allowed in type signatures
30
-
| help: replace with an appropriate return type: `impl Fn() -> i32`
31
+
| ^ not allowed in type signatures
31
32
|
32
33
= note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html
34
+
help: replace with an appropriate return type
35
+
|
36
+
LL - fn fun() -> _ {
37
+
LL + fn fun() -> impl Fn() -> i32 {
38
+
|
33
39
34
40
error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
0 commit comments