let_chains: Remove redundant tests in syntax-ambiguity-*.rs.

This commit is contained in:
Mazdak Farrokhzad 2019-05-11 15:11:54 +02:00
parent d45dadd951
commit b425df0be1
4 changed files with 0 additions and 188 deletions

View file

@ -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) { }
}

View file

@ -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

View file

@ -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) { }
}

View file

@ -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