From b425df0be106dfb97ec85031f8b60e33edd983e2 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Sat, 11 May 2019 15:11:54 +0200 Subject: [PATCH] let_chains: Remove redundant tests in syntax-ambiguity-*.rs. --- .../syntax-ambiguity-2015.rs | 38 ------------- .../syntax-ambiguity-2015.stderr | 56 ------------------- .../syntax-ambiguity-2018.rs | 38 ------------- .../syntax-ambiguity-2018.stderr | 56 ------------------- 4 files changed, 188 deletions(-) delete mode 100644 src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs delete mode 100644 src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr delete mode 100644 src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs delete mode 100644 src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs deleted file mode 100644 index d79798d57e82..000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.rs +++ /dev/null @@ -1,38 +0,0 @@ -// edition:2015 - -// Enabling `ireffutable_let_patterns` isn't necessary for what this tests, but it makes coming up -// with examples easier. - -#[allow(irrefutable_let_patterns)] -fn main() { - use std::ops::Range; - - if let Range { start: _, end: _ } = true..true && false { } - //~^ ERROR ambiguous use of `&&` - - if let Range { start: _, end: _ } = true..true || false { } - //~^ ERROR ambiguous use of `||` - - while let Range { start: _, end: _ } = true..true && false { } - //~^ ERROR ambiguous use of `&&` - - while let Range { start: _, end: _ } = true..true || false { } - //~^ ERROR ambiguous use of `||` - - if let true = false && false { } - //~^ ERROR ambiguous use of `&&` - - while let true = (1 == 2) && false { } - //~^ ERROR ambiguous use of `&&` - - // The following cases are not an error as parenthesis are used to - // clarify intent: - - if let Range { start: _, end: _ } = true..(true || false) { } - - if let Range { start: _, end: _ } = true..(true && false) { } - - while let Range { start: _, end: _ } = true..(true || false) { } - - while let Range { start: _, end: _ } = true..(true && false) { } -} diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr deleted file mode 100644 index 2cd59fe56cf2..000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2015.stderr +++ /dev/null @@ -1,56 +0,0 @@ -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2015.rs:10:47 - | -LL | if let Range { start: _, end: _ } = true..true && false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `||` - --> $DIR/syntax-ambiguity-2015.rs:13:47 - | -LL | if let Range { start: _, end: _ } = true..true || false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true || false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2015.rs:16:50 - | -LL | while let Range { start: _, end: _ } = true..true && false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `||` - --> $DIR/syntax-ambiguity-2015.rs:19:50 - | -LL | while let Range { start: _, end: _ } = true..true || false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true || false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2015.rs:22:19 - | -LL | if let true = false && false { } - | ^^^^^^^^^^^^^^ help: consider adding parentheses: `(false && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2015.rs:25:22 - | -LL | while let true = (1 == 2) && false { } - | ^^^^^^^^^^^^^^^^^ help: consider adding parentheses: `((1 == 2) && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: aborting due to 6 previous errors - diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs deleted file mode 100644 index 687bf659416a..000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.rs +++ /dev/null @@ -1,38 +0,0 @@ -// edition:2018 - -// Enabling `ireffutable_let_patterns` isn't necessary for what this tests, but it makes coming up -// with examples easier. - -#[allow(irrefutable_let_patterns)] -fn main() { - use std::ops::Range; - - if let Range { start: _, end: _ } = true..true && false { } - //~^ ERROR ambiguous use of `&&` - - if let Range { start: _, end: _ } = true..true || false { } - //~^ ERROR ambiguous use of `||` - - while let Range { start: _, end: _ } = true..true && false { } - //~^ ERROR ambiguous use of `&&` - - while let Range { start: _, end: _ } = true..true || false { } - //~^ ERROR ambiguous use of `||` - - if let true = false && false { } - //~^ ERROR ambiguous use of `&&` - - while let true = (1 == 2) && false { } - //~^ ERROR ambiguous use of `&&` - - // The following cases are not an error as parenthesis are used to - // clarify intent: - - if let Range { start: _, end: _ } = true..(true || false) { } - - if let Range { start: _, end: _ } = true..(true && false) { } - - while let Range { start: _, end: _ } = true..(true || false) { } - - while let Range { start: _, end: _ } = true..(true && false) { } -} diff --git a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr b/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr deleted file mode 100644 index cbba2d747333..000000000000 --- a/src/test/ui/rfc-2497-if-let-chains/syntax-ambiguity-2018.stderr +++ /dev/null @@ -1,56 +0,0 @@ -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2018.rs:10:47 - | -LL | if let Range { start: _, end: _ } = true..true && false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `||` - --> $DIR/syntax-ambiguity-2018.rs:13:47 - | -LL | if let Range { start: _, end: _ } = true..true || false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true || false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2018.rs:16:50 - | -LL | while let Range { start: _, end: _ } = true..true && false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `||` - --> $DIR/syntax-ambiguity-2018.rs:19:50 - | -LL | while let Range { start: _, end: _ } = true..true || false { } - | ^^^^^^^^^^^^^ help: consider adding parentheses: `(true || false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2018.rs:22:19 - | -LL | if let true = false && false { } - | ^^^^^^^^^^^^^^ help: consider adding parentheses: `(false && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: ambiguous use of `&&` - --> $DIR/syntax-ambiguity-2018.rs:25:22 - | -LL | while let true = (1 == 2) && false { } - | ^^^^^^^^^^^^^^^^^ help: consider adding parentheses: `((1 == 2) && false)` - | - = note: this will be a error until the `let_chains` feature is stabilized - = note: see rust-lang/rust#53668 for more information - -error: aborting due to 6 previous errors -