rust/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr
2023-06-05 16:09:46 +00:00

1912 lines
61 KiB
Plaintext

error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:29:9
|
LL | if (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:33:11
|
LL | if (((let 0 = 1))) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:37:9
|
LL | if (let 0 = 1) && true {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:41:17
|
LL | if true && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:45:9
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:45:24
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:51:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:51:48
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:51:61
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:61:12
|
LL | while (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:65:14
|
LL | while (((let 0 = 1))) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:69:12
|
LL | while (let 0 = 1) && true {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:73:20
|
LL | while true && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:77:12
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:77:27
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:83:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:83:51
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:83:64
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:110:9
|
LL | if &let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:115:9
|
LL | if !let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:118:9
|
LL | if *let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:122:9
|
LL | if -let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:132:9
|
LL | if (let 0 = 0)? {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:138:16
|
LL | if true || let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:141:17
|
LL | if (true || let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:144:25
|
LL | if true && (true || let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:147:25
|
LL | if true || (true && let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:152:12
|
LL | if x = let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:157:15
|
LL | if true..(let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:161:11
|
LL | if ..(let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:165:9
|
LL | if (let 0 = 0).. {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:196:19
|
LL | if let true = let true = true {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:202:12
|
LL | while &let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:207:12
|
LL | while !let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:210:12
|
LL | while *let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:214:12
|
LL | while -let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:224:12
|
LL | while (let 0 = 0)? {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:230:19
|
LL | while true || let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:233:20
|
LL | while (true || let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:236:28
|
LL | while true && (true || let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:239:28
|
LL | while true || (true && let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:244:15
|
LL | while x = let 0 = 0 {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:249:18
|
LL | while true..(let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:253:14
|
LL | while ..(let 0 = 0) {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:257:12
|
LL | while (let 0 = 0).. {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:288:22
|
LL | while let true = let true = true {}
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:304:6
|
LL | &let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:308:6
|
LL | !let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:311:6
|
LL | *let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:315:6
|
LL | -let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:325:6
|
LL | (let 0 = 0)?;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:331:13
|
LL | true || let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:334:14
|
LL | (true || let 0 = 0);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:337:22
|
LL | true && (true || let 0 = 0);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:342:9
|
LL | x = let 0 = 0;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:346:12
|
LL | true..(let 0 = 0);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:349:8
|
LL | ..(let 0 = 0);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:352:6
|
LL | (let 0 = 0)..;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:356:6
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:361:6
|
LL | (let true = let true = true);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:361:17
|
LL | (let true = let true = true);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:368:25
|
LL | let x = true && let y = 1;
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:374:19
|
LL | [1, 2, 3][let _ = ()]
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:379:6
|
LL | &let 0 = 0
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:391:17
|
LL | true && let 1 = 1
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:397:17
|
LL | true && let 1 = 1
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:403:17
|
LL | true && let 1 = 1
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:415:17
|
LL | true && let 1 = 1
| ^^^
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/disallowed-positions.rs:415:9
|
LL | true && let 1 = 1
| ^^^^^^^^^^^^^^^^^
|
help: enclose the `const` expression in braces
|
LL | { true && let 1 = 1 }
| + +
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:425:9
|
LL | if (let Some(a) = opt && true) {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:430:9
|
LL | if (let Some(a) = opt) && true {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:434:9
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:434:32
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:443:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:443:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:449:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:449:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:455:9
|
LL | if (let Some(a) = opt && (true)) && true {
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:472:22
|
LL | let x = (true && let y = 1);
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:477:20
|
LL | ([1, 2, 3][let _ = ()])
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:99:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^
error: expected expression, found `let` statement
--> $DIR/disallowed-positions.rs:103:16
|
LL | use_expr!((let 0 = 1));
| ^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:29:9
|
LL | if (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:29:9
|
LL | if (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:33:11
|
LL | if (((let 0 = 1))) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:33:11
|
LL | if (((let 0 = 1))) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:37:9
|
LL | if (let 0 = 1) && true {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:37:9
|
LL | if (let 0 = 1) && true {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:41:17
|
LL | if true && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:41:17
|
LL | if true && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:45:9
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:45:9
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:45:24
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:45:24
|
LL | if (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:51:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:51:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:51:48
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:51:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:51:61
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:51:35
|
LL | if let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:61:12
|
LL | while (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:61:12
|
LL | while (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:65:14
|
LL | while (((let 0 = 1))) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:65:14
|
LL | while (((let 0 = 1))) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:69:12
|
LL | while (let 0 = 1) && true {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:69:12
|
LL | while (let 0 = 1) && true {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:73:20
|
LL | while true && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:73:20
|
LL | while true && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:77:12
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:77:12
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:77:27
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:77:27
|
LL | while (let 0 = 1) && (let 0 = 1) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:83:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:83:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:83:51
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:83:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:83:64
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:83:38
|
LL | while let 0 = 1 && let 1 = 2 && (let 2 = 3 && let 3 = 4 && let 4 = 5) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:99:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:99:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:99:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:99:16
|
LL | use_expr!((let 0 = 1 && 0 == 0));
| ^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:103:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:103:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:103:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:103:16
|
LL | use_expr!((let 0 = 1));
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:110:9
|
LL | if &let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:115:9
|
LL | if !let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:118:9
|
LL | if *let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:122:9
|
LL | if -let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:132:9
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:132:9
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:138:16
|
LL | if true || let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:138:13
|
LL | if true || let 0 = 0 {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:141:17
|
LL | if (true || let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:141:14
|
LL | if (true || let 0 = 0) {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:144:25
|
LL | if true && (true || let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:144:22
|
LL | if true && (true || let 0 = 0) {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:147:25
|
LL | if true || (true && let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:147:17
|
LL | if true || (true && let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:152:12
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:157:15
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:157:15
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:161:11
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:161:11
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:165:9
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:165:9
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:171:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:175:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:182:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:190:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:196:19
|
LL | if let true = let true = true {}
| ^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:202:12
|
LL | while &let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:207:12
|
LL | while !let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:210:12
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:214:12
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:224:12
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:224:12
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:230:19
|
LL | while true || let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:230:16
|
LL | while true || let 0 = 0 {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:233:20
|
LL | while (true || let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:233:17
|
LL | while (true || let 0 = 0) {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:236:28
|
LL | while true && (true || let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:236:25
|
LL | while true && (true || let 0 = 0) {}
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:239:28
|
LL | while true || (true && let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:239:20
|
LL | while true || (true && let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:244:15
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:249:18
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:249:18
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:253:14
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:253:14
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:257:12
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:257:12
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:263:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:267:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:274:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:282:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:288:22
|
LL | while let true = let true = true {}
| ^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:304:6
|
LL | &let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:308:6
|
LL | !let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:311:6
|
LL | *let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:315:6
|
LL | -let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:325:6
|
LL | (let 0 = 0)?;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:325:6
|
LL | (let 0 = 0)?;
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:331:13
|
LL | true || let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:331:10
|
LL | true || let 0 = 0;
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:334:14
|
LL | (true || let 0 = 0);
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:334:11
|
LL | (true || let 0 = 0);
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:337:22
|
LL | true && (true || let 0 = 0);
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `||` operators are not supported in let chain expressions
--> $DIR/disallowed-positions.rs:337:19
|
LL | true && (true || let 0 = 0);
| ^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:342:9
|
LL | x = let 0 = 0;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:346:12
|
LL | true..(let 0 = 0);
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:346:12
|
LL | true..(let 0 = 0);
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:349:8
|
LL | ..(let 0 = 0);
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:349:8
|
LL | ..(let 0 = 0);
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:352:6
|
LL | (let 0 = 0)..;
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:352:6
|
LL | (let 0 = 0)..;
| ^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:356:6
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:361:6
|
LL | (let true = let true = true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:361:6
|
LL | (let true = let true = true);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:379:6
|
LL | &let 0 = 0
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:391:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:397:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:403:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:415:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:425:9
|
LL | if (let Some(a) = opt && true) {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:425:9
|
LL | if (let Some(a) = opt && true) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:430:9
|
LL | if (let Some(a) = opt) && true {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:430:9
|
LL | if (let Some(a) = opt) && true {
| ^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:434:9
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:434:9
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:434:32
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:434:32
|
LL | if (let Some(a) = opt) && (let Some(b) = a) {
| ^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:443:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:443:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:443:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:443:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && b == 1 {
| ^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:449:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:449:9
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:449:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:449:31
|
LL | if (let Some(a) = opt && (let Some(b) = a)) && true {
| ^^^^^^^^^^^^^^^
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:455:9
|
LL | if (let Some(a) = opt && (true)) && true {
| ^^^^^^^^^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
note: `let`s wrapped in parentheses are not supported in a context with let chains
--> $DIR/disallowed-positions.rs:455:9
|
LL | if (let Some(a) = opt && (true)) && true {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:110:8
|
LL | if &let 0 = 0 {}
| ^^^^^^^^^^ expected `bool`, found `&bool`
|
help: consider removing the borrow
|
LL - if &let 0 = 0 {}
LL + if let 0 = 0 {}
|
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:118:8
|
LL | if *let 0 = 0 {}
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
--> $DIR/disallowed-positions.rs:122:8
|
LL | if -let 0 = 0 {}
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:132:8
|
LL | if (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
|
= help: the trait `Try` is not implemented for `bool`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:132:19
|
LL | fn nested_within_if_expr() {
| -------------------------- this function should return `Result` or `Option` to accept `?`
...
LL | if (let 0 = 0)? {}
| ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:152:8
|
LL | if x = let 0 = 0 {}
| ^^^^^^^^^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | if x == let 0 = 0 {}
| +
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:157:8
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:161:8
|
LL | if ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
|
= note: expected type `bool`
found struct `RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:165:8
|
LL | if (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
|
= note: expected type `bool`
found struct `RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:171:12
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:171:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:175:12
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:175:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:182:12
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
| expected fn pointer, found `Range<_>`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:182:41
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
found closure `[closure@$DIR/disallowed-positions.rs:182:41: 182:43]`
help: use parentheses to call this closure
|
LL | if let Range { start: F, end } = F..(|| true)() {}
| + +++
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:182:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:190:12
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:190:44
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected `bool`, found `&&bool`
|
help: consider removing the `&&`
|
LL - if let Range { start: true, end } = t..&&false {}
LL + if let Range { start: true, end } = t..false {}
|
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:190:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:128:20
|
LL | if let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
|
= help: the trait `Try` is not implemented for `{integer}`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:202:11
|
LL | while &let 0 = 0 {}
| ^^^^^^^^^^ expected `bool`, found `&bool`
|
help: consider removing the borrow
|
LL - while &let 0 = 0 {}
LL + while let 0 = 0 {}
|
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:210:11
|
LL | while *let 0 = 0 {}
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
--> $DIR/disallowed-positions.rs:214:11
|
LL | while -let 0 = 0 {}
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:224:11
|
LL | while (let 0 = 0)? {}
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
|
= help: the trait `Try` is not implemented for `bool`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:224:22
|
LL | fn nested_within_while_expr() {
| ----------------------------- this function should return `Result` or `Option` to accept `?`
...
LL | while (let 0 = 0)? {}
| ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:244:11
|
LL | while x = let 0 = 0 {}
| ^^^^^^^^^^^^^ expected `bool`, found `()`
|
help: you might have meant to compare for equality
|
LL | while x == let 0 = 0 {}
| +
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:249:11
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:253:11
|
LL | while ..(let 0 = 0) {}
| ^^^^^^^^^^^^^ expected `bool`, found `RangeTo<bool>`
|
= note: expected type `bool`
found struct `RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:257:11
|
LL | while (let 0 = 0).. {}
| ^^^^^^^^^^^^^ expected `bool`, found `RangeFrom<bool>`
|
= note: expected type `bool`
found struct `RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:263:15
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:263:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:267:15
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:267:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:274:15
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
| expected fn pointer, found `Range<_>`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:274:44
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
found closure `[closure@$DIR/disallowed-positions.rs:274:44: 274:46]`
help: use parentheses to call this closure
|
LL | while let Range { start: F, end } = F..(|| true)() {}
| + +++
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:274:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:282:15
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:282:47
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^ expected `bool`, found `&&bool`
|
help: consider removing the `&&`
|
LL - while let Range { start: true, end } = t..&&false {}
LL + while let Range { start: true, end } = t..false {}
|
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:282:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found `Range<bool>`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:220:23
|
LL | while let 0 = 0? {}
| ^^ the `?` operator cannot be applied to type `{integer}`
|
= help: the trait `Try` is not implemented for `{integer}`
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:311:5
|
LL | *let 0 = 0;
| ^^^^^^^^^^
error[E0600]: cannot apply unary operator `-` to type `bool`
--> $DIR/disallowed-positions.rs:315:5
|
LL | -let 0 = 0;
| ^^^^^^^^^^ cannot apply unary operator `-`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:325:5
|
LL | (let 0 = 0)?;
| ^^^^^^^^^^^^ the `?` operator cannot be applied to type `bool`
|
= help: the trait `Try` is not implemented for `bool`
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `FromResidual`)
--> $DIR/disallowed-positions.rs:325:16
|
LL | fn outside_if_and_while_expr() {
| ------------------------------ this function should return `Result` or `Option` to accept `?`
...
LL | (let 0 = 0)?;
| ^ cannot use the `?` operator in a function that returns `()`
|
= help: the trait `FromResidual<_>` is not implemented for `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:356:10
|
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found `Range<_>`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:379:5
|
LL | fn outside_if_and_while_expr() {
| - help: try adding a return type: `-> &bool`
...
LL | &let 0 = 0
| ^^^^^^^^^^ expected `()`, found `&bool`
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/disallowed-positions.rs:321:17
|
LL | let 0 = 0?;
| ^^ the `?` operator cannot be applied to type `{integer}`
|
= help: the trait `Try` is not implemented for `{integer}`
error: aborting due to 215 previous errors
Some errors have detailed explanations: E0277, E0308, E0600, E0614.
For more information about an error, try `rustc --explain E0277`.