summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/precedence.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/precedence.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/precedence.stderr')
-rw-r--r--src/tools/clippy/tests/ui/precedence.stderr76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/precedence.stderr b/src/tools/clippy/tests/ui/precedence.stderr
new file mode 100644
index 000000000..03d585b39
--- /dev/null
+++ b/src/tools/clippy/tests/ui/precedence.stderr
@@ -0,0 +1,76 @@
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:17:5
+ |
+LL | 1 << 2 + 3;
+ | ^^^^^^^^^^ help: consider parenthesizing your expression: `1 << (2 + 3)`
+ |
+ = note: `-D clippy::precedence` implied by `-D warnings`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:18:5
+ |
+LL | 1 + 2 << 3;
+ | ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 2) << 3`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:19:5
+ |
+LL | 4 >> 1 + 1;
+ | ^^^^^^^^^^ help: consider parenthesizing your expression: `4 >> (1 + 1)`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:20:5
+ |
+LL | 1 + 3 >> 2;
+ | ^^^^^^^^^^ help: consider parenthesizing your expression: `(1 + 3) >> 2`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:21:5
+ |
+LL | 1 ^ 1 - 1;
+ | ^^^^^^^^^ help: consider parenthesizing your expression: `1 ^ (1 - 1)`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:22:5
+ |
+LL | 3 | 2 - 1;
+ | ^^^^^^^^^ help: consider parenthesizing your expression: `3 | (2 - 1)`
+
+error: operator precedence can trip the unwary
+ --> $DIR/precedence.rs:23:5
+ |
+LL | 3 & 5 - 2;
+ | ^^^^^^^^^ help: consider parenthesizing your expression: `3 & (5 - 2)`
+
+error: unary minus has lower precedence than method call
+ --> $DIR/precedence.rs:24:5
+ |
+LL | -1i32.abs();
+ | ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1i32.abs())`
+
+error: unary minus has lower precedence than method call
+ --> $DIR/precedence.rs:25:5
+ |
+LL | -1f32.abs();
+ | ^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1f32.abs())`
+
+error: unary minus has lower precedence than method call
+ --> $DIR/precedence.rs:52:13
+ |
+LL | let _ = -1.0_f64.cos().cos();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.cos().cos())`
+
+error: unary minus has lower precedence than method call
+ --> $DIR/precedence.rs:53:13
+ |
+LL | let _ = -1.0_f64.cos().sin();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.cos().sin())`
+
+error: unary minus has lower precedence than method call
+ --> $DIR/precedence.rs:54:13
+ |
+LL | let _ = -1.0_f64.sin().cos();
+ | ^^^^^^^^^^^^^^^^^^^^ help: consider adding parentheses to clarify your intent: `-(1.0_f64.sin().cos())`
+
+error: aborting due to 12 previous errors
+