|
| 1 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 2 | + --> $DIR/negative_literals.rs:4:13 |
| 3 | + | |
| 4 | +LL | let _ = -1i32.abs(); |
| 5 | + | ^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 8 | + = note: `#[deny(ambiguous_negative_literals)]` on by default |
| 9 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 10 | + | |
| 11 | +LL | let _ = (-1i32).abs(); |
| 12 | + | + + |
| 13 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 14 | + | |
| 15 | +LL | let _ = -(1i32.abs()); |
| 16 | + | + + |
| 17 | + |
| 18 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 19 | + --> $DIR/negative_literals.rs:6:13 |
| 20 | + | |
| 21 | +LL | let _ = -1f32.abs(); |
| 22 | + | ^^^^^^^^^^^ |
| 23 | + | |
| 24 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 25 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 26 | + | |
| 27 | +LL | let _ = (-1f32).abs(); |
| 28 | + | + + |
| 29 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 30 | + | |
| 31 | +LL | let _ = -(1f32.abs()); |
| 32 | + | + + |
| 33 | + |
| 34 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 35 | + --> $DIR/negative_literals.rs:8:13 |
| 36 | + | |
| 37 | +LL | let _ = -1f64.asin(); |
| 38 | + | ^^^^^^^^^^^^ |
| 39 | + | |
| 40 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 41 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 42 | + | |
| 43 | +LL | let _ = (-1f64).asin(); |
| 44 | + | + + |
| 45 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 46 | + | |
| 47 | +LL | let _ = -(1f64.asin()); |
| 48 | + | + + |
| 49 | + |
| 50 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 51 | + --> $DIR/negative_literals.rs:10:13 |
| 52 | + | |
| 53 | +LL | let _ = -1f64.asinh(); |
| 54 | + | ^^^^^^^^^^^^^ |
| 55 | + | |
| 56 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 57 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 58 | + | |
| 59 | +LL | let _ = (-1f64).asinh(); |
| 60 | + | + + |
| 61 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 62 | + | |
| 63 | +LL | let _ = -(1f64.asinh()); |
| 64 | + | + + |
| 65 | + |
| 66 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 67 | + --> $DIR/negative_literals.rs:12:13 |
| 68 | + | |
| 69 | +LL | let _ = -1f64.tan(); |
| 70 | + | ^^^^^^^^^^^ |
| 71 | + | |
| 72 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 73 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 74 | + | |
| 75 | +LL | let _ = (-1f64).tan(); |
| 76 | + | + + |
| 77 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 78 | + | |
| 79 | +LL | let _ = -(1f64.tan()); |
| 80 | + | + + |
| 81 | + |
| 82 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 83 | + --> $DIR/negative_literals.rs:14:13 |
| 84 | + | |
| 85 | +LL | let _ = -1f64.tanh(); |
| 86 | + | ^^^^^^^^^^^^ |
| 87 | + | |
| 88 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 89 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 90 | + | |
| 91 | +LL | let _ = (-1f64).tanh(); |
| 92 | + | + + |
| 93 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 94 | + | |
| 95 | +LL | let _ = -(1f64.tanh()); |
| 96 | + | + + |
| 97 | + |
| 98 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 99 | + --> $DIR/negative_literals.rs:16:13 |
| 100 | + | |
| 101 | +LL | let _ = -1.0_f64.cos().cos(); |
| 102 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 103 | + | |
| 104 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 105 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 106 | + | |
| 107 | +LL | let _ = (-1.0_f64).cos().cos(); |
| 108 | + | + + |
| 109 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 110 | + | |
| 111 | +LL | let _ = -(1.0_f64.cos().cos()); |
| 112 | + | + + |
| 113 | + |
| 114 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 115 | + --> $DIR/negative_literals.rs:18:13 |
| 116 | + | |
| 117 | +LL | let _ = -1.0_f64.cos().sin(); |
| 118 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 119 | + | |
| 120 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 121 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 122 | + | |
| 123 | +LL | let _ = (-1.0_f64).cos().sin(); |
| 124 | + | + + |
| 125 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 126 | + | |
| 127 | +LL | let _ = -(1.0_f64.cos().sin()); |
| 128 | + | + + |
| 129 | + |
| 130 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 131 | + --> $DIR/negative_literals.rs:20:13 |
| 132 | + | |
| 133 | +LL | let _ = -1.0_f64.sin().cos(); |
| 134 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 135 | + | |
| 136 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 137 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 138 | + | |
| 139 | +LL | let _ = (-1.0_f64).sin().cos(); |
| 140 | + | + + |
| 141 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 142 | + | |
| 143 | +LL | let _ = -(1.0_f64.sin().cos()); |
| 144 | + | + + |
| 145 | + |
| 146 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 147 | + --> $DIR/negative_literals.rs:22:13 |
| 148 | + | |
| 149 | +LL | let _ = -1f64.sin().sin(); |
| 150 | + | ^^^^^^^^^^^^^^^^^ |
| 151 | + | |
| 152 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 153 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 154 | + | |
| 155 | +LL | let _ = (-1f64).sin().sin(); |
| 156 | + | + + |
| 157 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 158 | + | |
| 159 | +LL | let _ = -(1f64.sin().sin()); |
| 160 | + | + + |
| 161 | + |
| 162 | +error: `-` has lower precedence than method calls, which might be unexpected |
| 163 | + --> $DIR/negative_literals.rs:25:11 |
| 164 | + | |
| 165 | +LL | dbg!( -1.0_f32.cos() ); |
| 166 | + | ^^^^^^^^^^^^^^ |
| 167 | + | |
| 168 | + = note: e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4` |
| 169 | +help: add parentheses around the `-` and the literal to call the method on a negative literal |
| 170 | + | |
| 171 | +LL | dbg!( (-1.0_f32).cos() ); |
| 172 | + | + + |
| 173 | +help: add parentheses around the literal and the method call to keep the current behavior |
| 174 | + | |
| 175 | +LL | dbg!( -(1.0_f32.cos()) ); |
| 176 | + | + + |
| 177 | + |
| 178 | +error: aborting due to 11 previous errors |
| 179 | + |
0 commit comments