error chained-comparison
What it means#
The comparison operators == != < <= > >= <=> in have precedence level 4 and no associativity (§5.2), so a < b < c is an error rather than a silently surprising (a < b) < c.
Example#
fn inRange(x: i32) -> bool {
0 < x < 10 // <- chained-comparison
}error
chained-comparison
How to fix#
fn inRange(x: i32) -> bool {
0 < x && x < 10
}Join the comparisons explicitly with &&, or use a range test such as x in 1..10.