|
| 1 | +error: right curly brace `}` before `else` in a `let...else` statement not allowed |
| 2 | + --> $DIR/bad-let-else-statement.rs:5:5 |
| 3 | + | |
| 4 | +LL | } else { |
| 5 | + | ^ |
| 6 | + | |
| 7 | +help: wrap the expression in parentheses |
| 8 | + | |
| 9 | +LL ~ let foo = ({ |
| 10 | +LL | 1 |
| 11 | +LL ~ }) else { |
| 12 | + | |
| 13 | + |
| 14 | +error: `for...else` loops are not supported |
| 15 | + --> $DIR/bad-let-else-statement.rs:14:7 |
| 16 | + | |
| 17 | +LL | let foo = for i in 1..2 { |
| 18 | + | --- `else` is attached to this loop |
| 19 | +LL | break; |
| 20 | +LL | } else { |
| 21 | + | _______^ |
| 22 | +LL | | |
| 23 | +LL | | return; |
| 24 | +LL | | }; |
| 25 | + | |_____^ |
| 26 | + | |
| 27 | + = note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run |
| 28 | + |
| 29 | +error: right curly brace `}` before `else` in a `let...else` statement not allowed |
| 30 | + --> $DIR/bad-let-else-statement.rs:25:5 |
| 31 | + | |
| 32 | +LL | } else { |
| 33 | + | ^ |
| 34 | + | |
| 35 | +help: wrap the expression in parentheses |
| 36 | + | |
| 37 | +LL ~ let foo = (if true { |
| 38 | +LL | 1 |
| 39 | +LL | } else { |
| 40 | +LL | 0 |
| 41 | +LL ~ }) else { |
| 42 | + | |
| 43 | + |
| 44 | +error: `loop...else` loops are not supported |
| 45 | + --> $DIR/bad-let-else-statement.rs:34:7 |
| 46 | + | |
| 47 | +LL | let foo = loop { |
| 48 | + | ---- `else` is attached to this loop |
| 49 | +LL | break; |
| 50 | +LL | } else { |
| 51 | + | _______^ |
| 52 | +LL | | |
| 53 | +LL | | return; |
| 54 | +LL | | }; |
| 55 | + | |_____^ |
| 56 | + | |
| 57 | + = note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run |
| 58 | + |
| 59 | +error: right curly brace `}` before `else` in a `let...else` statement not allowed |
| 60 | + --> $DIR/bad-let-else-statement.rs:44:5 |
| 61 | + | |
| 62 | +LL | } else { |
| 63 | + | ^ |
| 64 | + | |
| 65 | +help: wrap the expression in parentheses |
| 66 | + | |
| 67 | +LL ~ let foo = (match true { |
| 68 | +LL | true => 1, |
| 69 | +LL | false => 0 |
| 70 | +LL ~ }) else { |
| 71 | + | |
| 72 | + |
| 73 | +error: right curly brace `}` before `else` in a `let...else` statement not allowed |
| 74 | + --> $DIR/bad-let-else-statement.rs:54:5 |
| 75 | + | |
| 76 | +LL | } else { |
| 77 | + | ^ |
| 78 | + | |
| 79 | +help: wrap the expression in parentheses |
| 80 | + | |
| 81 | +LL ~ let foo = (X { |
| 82 | +LL | |
| 83 | +LL ~ }) else { |
| 84 | + | |
| 85 | + |
| 86 | +error: `while...else` loops are not supported |
| 87 | + --> $DIR/bad-let-else-statement.rs:63:7 |
| 88 | + | |
| 89 | +LL | let foo = while false { |
| 90 | + | ----- `else` is attached to this loop |
| 91 | +LL | break; |
| 92 | +LL | } else { |
| 93 | + | _______^ |
| 94 | +LL | | |
| 95 | +LL | | return; |
| 96 | +LL | | }; |
| 97 | + | |_____^ |
| 98 | + | |
| 99 | + = note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run |
| 100 | + |
| 101 | +error: right curly brace `}` before `else` in a `let...else` statement not allowed |
| 102 | + --> $DIR/bad-let-else-statement.rs:72:5 |
| 103 | + | |
| 104 | +LL | } else { |
| 105 | + | ^ |
| 106 | + | |
| 107 | +help: wrap the expression in parentheses |
| 108 | + | |
| 109 | +LL ~ let foo = (const { |
| 110 | +LL | 1 |
| 111 | +LL ~ }) else { |
| 112 | + | |
| 113 | + |
| 114 | +error: aborting due to 8 previous errors |
| 115 | + |
0 commit comments