rust/tests/ui/ifs_same_cond.stderr
Samuel Tardieu 287a9421d3 comparison_chain: stylepedantic
The `comparison_chain` lint might suggest code which seems less natural
to beginners.

[Discussion](https://rust-lang.zulipchat.com/#narrow/channel/257328-clippy/topic/demote.20some.20lints.20to.20.60pedantic.60)
2025-02-15 16:24:38 +01:00

52 lines
1.2 KiB
Text

error: this `if` has the same condition as a previous `if`
--> tests/ui/ifs_same_cond.rs:9:15
|
LL | } else if b {
| ^
|
note: same as this
--> tests/ui/ifs_same_cond.rs:8:8
|
LL | if b {
| ^
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ifs_same_cond)]`
error: this `if` has the same condition as a previous `if`
--> tests/ui/ifs_same_cond.rs:14:15
|
LL | } else if a == 1 {
| ^^^^^^
|
note: same as this
--> tests/ui/ifs_same_cond.rs:13:8
|
LL | if a == 1 {
| ^^^^^^
error: this `if` has the same condition as a previous `if`
--> tests/ui/ifs_same_cond.rs:20:15
|
LL | } else if 2 * a == 1 {
| ^^^^^^^^^^
|
note: same as this
--> tests/ui/ifs_same_cond.rs:18:8
|
LL | if 2 * a == 1 {
| ^^^^^^^^^^
error: this `if` has the same condition as a previous `if`
--> tests/ui/ifs_same_cond.rs:53:15
|
LL | } else if a.contains("ah") {
| ^^^^^^^^^^^^^^^^
|
note: same as this
--> tests/ui/ifs_same_cond.rs:52:8
|
LL | if a.contains("ah") {
| ^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors