File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change 1
- error: leading `+` is not supported
2
- --> $DIR/issue-36499.rs:4:9
1
+ error: Rust has no postfix increment operator
2
+ --> $DIR/issue-36499.rs:4:7
3
3
|
4
4
LL | 2 + +2;
5
- | ^ unexpected `+`
5
+ | ^^^ not a valid postfix operator
6
6
|
7
- help: try removing the `+`
7
+ help: use `+= 1` instead
8
+ |
9
+ LL | { let tmp = 2 ; 2 += 1; tmp }2;
10
+ | +++++++++++ ~~~~~~~~~~~~~~~
11
+ help: or, if you don't need to use it as an expression, change it to this
8
12
|
9
13
LL - 2 + +2;
10
- LL + 2 + 2 ;
14
+ LL + 2 += 12 ;
11
15
|
12
16
13
17
error: aborting due to previous error
Original file line number Diff line number Diff line change @@ -10,16 +10,20 @@ LL - let _ = +1;
10
10
LL + let _ = 1;
11
11
|
12
12
13
- error: leading `+` is not supported
14
- --> $DIR/issue-88276-unary-plus.rs:5:20
13
+ error: Rust has no postfix increment operator
14
+ --> $DIR/issue-88276-unary-plus.rs:5:18
15
15
|
16
16
LL | let _ = (1.0 + +2.0) * +3.0;
17
- | ^ unexpected `+`
17
+ | ^^^ not a valid postfix operator
18
18
|
19
- help: try removing the `+`
19
+ help: use `+= 1` instead
20
+ |
21
+ LL | let _ = ({ let tmp = 1.0 ; 1.0 += 1; tmp }2.0) * +3.0;
22
+ | +++++++++++ ~~~~~~~~~~~~~~~~~
23
+ help: or, if you don't need to use it as an expression, change it to this
20
24
|
21
25
LL - let _ = (1.0 + +2.0) * +3.0;
22
- LL + let _ = (1.0 + 2 .0) * +3.0;
26
+ LL + let _ = (1.0 += 12 .0) * +3.0;
23
27
|
24
28
25
29
error: leading `+` is not supported
You can’t perform that action at this time.
0 commit comments