summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2022-02-17 16:30:48 -0800
committerNoah Lev <camelidcamel@gmail.com>2022-03-23 22:31:57 -0700
commit4212835d993537158aa39406a489351a4efdda71 (patch)
tree25ba3362dae10825466043e4a5fd719eb27f3fca /src/test/ui/parser
parent29a5c363c7af619c1264c8b1e80241e503b27b47 (diff)
downloadrust-4212835d993537158aa39406a489351a4efdda71.tar.gz
rust-4212835d993537158aa39406a489351a4efdda71.zip
Add heuristic to avoid treating `x + +2` as increment
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/issues/issue-88276-unary-plus.stderr14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/test/ui/parser/issues/issue-88276-unary-plus.stderr b/src/test/ui/parser/issues/issue-88276-unary-plus.stderr
index e65bac2c5cc..b26761729a8 100644
--- a/src/test/ui/parser/issues/issue-88276-unary-plus.stderr
+++ b/src/test/ui/parser/issues/issue-88276-unary-plus.stderr
@@ -10,20 +10,16 @@ LL -     let _ = +1;
 LL +     let _ = 1;
    | 
 
-error: Rust has no postfix increment operator
-  --> $DIR/issue-88276-unary-plus.rs:5:18
+error: leading `+` is not supported
+  --> $DIR/issue-88276-unary-plus.rs:5:20
    |
 LL |     let _ = (1.0 + +2.0) * +3.0;
-   |                  ^^^ not a valid postfix operator
-   |
-help: use `+= 1` instead
+   |                    ^ unexpected `+`
    |
-LL |     let _ = ({ let tmp = 1.0 ; 1.0 += 1; tmp }2.0) * +3.0;
-   |              +++++++++++     ~~~~~~~~~~~~~~~~~
-help: or, if you don't need to use it as an expression, change it to this
+help: try removing the `+`
    |
 LL -     let _ = (1.0 + +2.0) * +3.0;
-LL +     let _ = (1.0  += 12.0) * +3.0;
+LL +     let _ = (1.0 + 2.0) * +3.0;
    | 
 
 error: leading `+` is not supported