1
1
error: `-` has lower precedence than method calls, which might be unexpected
2
- --> $DIR/negative_literals.rs:4 :13
2
+ --> $DIR/negative_literals.rs:6 :13
3
3
|
4
4
LL | let _ = -1i32.abs();
5
5
| ^^^^^^^^^^^
6
6
|
7
7
= note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4`
8
- = note: `#[deny(ambiguous_negative_literals)]` on by default
8
+ note: the lint level is defined here
9
+ --> $DIR/negative_literals.rs:3:9
10
+ |
11
+ LL | #![deny(ambiguous_negative_literals)]
12
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
9
13
help: add parentheses around the `-` and the literal to call the method on a negative literal
10
14
|
11
15
LL | let _ = (-1i32).abs();
@@ -16,7 +20,7 @@ LL | let _ = -(1i32.abs());
16
20
| + +
17
21
18
22
error: `-` has lower precedence than method calls, which might be unexpected
19
- --> $DIR/negative_literals.rs:6 :13
23
+ --> $DIR/negative_literals.rs:8 :13
20
24
|
21
25
LL | let _ = -1f32.abs();
22
26
| ^^^^^^^^^^^
@@ -32,7 +36,7 @@ LL | let _ = -(1f32.abs());
32
36
| + +
33
37
34
38
error: `-` has lower precedence than method calls, which might be unexpected
35
- --> $DIR/negative_literals.rs:8 :13
39
+ --> $DIR/negative_literals.rs:10 :13
36
40
|
37
41
LL | let _ = -1f64.asin();
38
42
| ^^^^^^^^^^^^
@@ -48,7 +52,7 @@ LL | let _ = -(1f64.asin());
48
52
| + +
49
53
50
54
error: `-` has lower precedence than method calls, which might be unexpected
51
- --> $DIR/negative_literals.rs:10 :13
55
+ --> $DIR/negative_literals.rs:12 :13
52
56
|
53
57
LL | let _ = -1f64.asinh();
54
58
| ^^^^^^^^^^^^^
@@ -64,7 +68,7 @@ LL | let _ = -(1f64.asinh());
64
68
| + +
65
69
66
70
error: `-` has lower precedence than method calls, which might be unexpected
67
- --> $DIR/negative_literals.rs:12 :13
71
+ --> $DIR/negative_literals.rs:14 :13
68
72
|
69
73
LL | let _ = -1f64.tan();
70
74
| ^^^^^^^^^^^
@@ -80,7 +84,7 @@ LL | let _ = -(1f64.tan());
80
84
| + +
81
85
82
86
error: `-` has lower precedence than method calls, which might be unexpected
83
- --> $DIR/negative_literals.rs:14 :13
87
+ --> $DIR/negative_literals.rs:16 :13
84
88
|
85
89
LL | let _ = -1f64.tanh();
86
90
| ^^^^^^^^^^^^
@@ -96,7 +100,7 @@ LL | let _ = -(1f64.tanh());
96
100
| + +
97
101
98
102
error: `-` has lower precedence than method calls, which might be unexpected
99
- --> $DIR/negative_literals.rs:16 :13
103
+ --> $DIR/negative_literals.rs:18 :13
100
104
|
101
105
LL | let _ = -1.0_f64.cos().cos();
102
106
| ^^^^^^^^^^^^^^^^^^^^
@@ -112,7 +116,7 @@ LL | let _ = -(1.0_f64.cos().cos());
112
116
| + +
113
117
114
118
error: `-` has lower precedence than method calls, which might be unexpected
115
- --> $DIR/negative_literals.rs:18 :13
119
+ --> $DIR/negative_literals.rs:20 :13
116
120
|
117
121
LL | let _ = -1.0_f64.cos().sin();
118
122
| ^^^^^^^^^^^^^^^^^^^^
@@ -128,7 +132,7 @@ LL | let _ = -(1.0_f64.cos().sin());
128
132
| + +
129
133
130
134
error: `-` has lower precedence than method calls, which might be unexpected
131
- --> $DIR/negative_literals.rs:20 :13
135
+ --> $DIR/negative_literals.rs:22 :13
132
136
|
133
137
LL | let _ = -1.0_f64.sin().cos();
134
138
| ^^^^^^^^^^^^^^^^^^^^
@@ -144,7 +148,7 @@ LL | let _ = -(1.0_f64.sin().cos());
144
148
| + +
145
149
146
150
error: `-` has lower precedence than method calls, which might be unexpected
147
- --> $DIR/negative_literals.rs:22 :13
151
+ --> $DIR/negative_literals.rs:24 :13
148
152
|
149
153
LL | let _ = -1f64.sin().sin();
150
154
| ^^^^^^^^^^^^^^^^^
@@ -160,7 +164,7 @@ LL | let _ = -(1f64.sin().sin());
160
164
| + +
161
165
162
166
error: `-` has lower precedence than method calls, which might be unexpected
163
- --> $DIR/negative_literals.rs:25 :11
167
+ --> $DIR/negative_literals.rs:27 :11
164
168
|
165
169
LL | dbg!( -1.0_f32.cos() );
166
170
| ^^^^^^^^^^^^^^
0 commit comments