about summary refs log tree commit diff
diff options
context:
space:
mode:
authorwangxiangqing <wangxiangqing@bytedance.com>2019-10-06 12:03:53 +0800
committerwangxiangqing <wangxiangqing@bytedance.com>2019-10-06 18:58:33 +0800
commitbbb69d14552b7258ba0b1d56d6558bd32b647b9a (patch)
tree2872f2a8e9e1939098cd91731041ea88cf512cbb
parent8a164acf5879aec3389180f7102ea32dce5eb07a (diff)
downloadrust-bbb69d14552b7258ba0b1d56d6558bd32b647b9a.tar.gz
rust-bbb69d14552b7258ba0b1d56d6558bd32b647b9a.zip
Suggest dereferencing boolean reference when used in 'if' or 'while'
Change-Id: I0c5c4d767be2647e6f017ae7bf83558c56dbca97
-rw-r--r--src/test/ui/if/if-no-match-bindings.stderr4
-rw-r--r--src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr38
2 files changed, 2 insertions, 40 deletions
diff --git a/src/test/ui/if/if-no-match-bindings.stderr b/src/test/ui/if/if-no-match-bindings.stderr
index 694b59897c5..53b7aafc430 100644
--- a/src/test/ui/if/if-no-match-bindings.stderr
+++ b/src/test/ui/if/if-no-match-bindings.stderr
@@ -73,7 +73,7 @@ LL |     while b_mut_ref() {}
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:26:11
    |
-26 |     while &true {}
+LL |     while &true {}
    |           ^^^^^
    |           |
    |           expected bool, found &bool
@@ -85,7 +85,7 @@ error[E0308]: mismatched types
 error[E0308]: mismatched types
   --> $DIR/if-no-match-bindings.rs:27:11
    |
-27 |     while &mut true {}
+LL |     while &mut true {}
    |           ^^^^^^^^^
    |           |
    |           expected bool, found &mut bool
diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
index ab1b405e5c2..619f9c85b24 100644
--- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
+++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr
@@ -513,44 +513,6 @@ warning: the feature `let_chains` is incomplete and may cause the compiler to cr
 LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
    |            ^^^^^^^^^^
 
-warning: unnecessary parentheses around `if` condition
-  --> $DIR/disallowed-positions.rs:51:8
-   |
-LL |     if (true || let 0 = 0) {}
-   |        ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-   |
-   = note: `#[warn(unused_parens)]` on by default
-
-warning: unnecessary parentheses around `while` condition
-  --> $DIR/disallowed-positions.rs:115:11
-   |
-LL |     while (true || let 0 = 0) {}
-   |           ^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-
-wrning: unnecessary parentheses around `let` head expression
-  --> $DIR/disallowed-positions.rs:160:41
-   |
-LL |     if let Range { start: _, end: _ } = (true..true || false) { }
-   |                                         ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-
-warning: unnecessary parentheses around `let` head expression
-  --> $DIR/disallowed-positions.rs:162:41
-   |
-LL |     if let Range { start: _, end: _ } = (true..true && false) { }
-   |                                         ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-
-warning: unnecessary parentheses around `let` head expression
-  --> $DIR/disallowed-positions.rs:164:44
-   |
-LL |     while let Range { start: _, end: _ } = (true..true || false) { }
-   |                                            ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-
-warning: unnecessary parentheses around `let` head expression
-  --> $DIR/disallowed-positions.rs:166:44
-   |
-LL |     while let Range { start: _, end: _ } = (true..true && false) { }
-   |                                            ^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
-
 error[E0308]: mismatched types
   --> $DIR/disallowed-positions.rs:32:8
    |