mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
aedc1b6ad4
The change to the test is a little goofy because the compiler was guessing "correctly" before that `falsy! {}` is the condition as opposed to the else body. But I believe this change is fundamentally correct. Braced macro invocations in statement position are most often item-like (`thread_local! {...}`) as opposed to parenthesized macro invocations which are condition-like (`cfg!(...)`).
97 lines
2.2 KiB
Plaintext
97 lines
2.2 KiB
Plaintext
error: expected `{`, found keyword `false`
|
|
--> $DIR/else-no-if.rs:7:12
|
|
|
|
|
LL | } else false {
|
|
| ---- ^^^^^
|
|
| |
|
|
| expected an `if` or a block after this `else`
|
|
|
|
|
help: add an `if` if this is the condition of a chained `else if` statement
|
|
|
|
|
LL | } else if false {
|
|
| ++
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:14:12
|
|
|
|
|
LL | } else falsy() {
|
|
| ---- ^^^^^
|
|
| |
|
|
| expected an `if` or a block after this `else`
|
|
|
|
|
help: add an `if` if this is the condition of a chained `else if` statement
|
|
|
|
|
LL | } else if falsy() {
|
|
| ++
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:21:12
|
|
|
|
|
LL | } else falsy();
|
|
| ^^^^^ expected `{`
|
|
|
|
|
help: try placing this code inside a block
|
|
|
|
|
LL | } else { falsy() };
|
|
| + +
|
|
|
|
error: expected `{`, found keyword `loop`
|
|
--> $DIR/else-no-if.rs:27:12
|
|
|
|
|
LL | } else loop{}
|
|
| ^^^^ expected `{`
|
|
|
|
|
help: try placing this code inside a block
|
|
|
|
|
LL | } else { loop{} }
|
|
| + +
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:34:12
|
|
|
|
|
LL | } else falsy!() {
|
|
| ---- ^^^^^
|
|
| |
|
|
| expected an `if` or a block after this `else`
|
|
|
|
|
help: add an `if` if this is the condition of a chained `else if` statement
|
|
|
|
|
LL | } else if falsy!() {
|
|
| ++
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:41:12
|
|
|
|
|
LL | } else falsy!();
|
|
| ^^^^^ expected `{`
|
|
|
|
|
help: try placing this code inside a block
|
|
|
|
|
LL | } else { falsy!() };
|
|
| + +
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:47:12
|
|
|
|
|
LL | } else falsy! {} {
|
|
| ^^^^^ expected `{`
|
|
|
|
|
help: try placing this code inside a block
|
|
|
|
|
LL | } else { falsy! {} } {
|
|
| + +
|
|
|
|
error: expected `{`, found `falsy`
|
|
--> $DIR/else-no-if.rs:54:12
|
|
|
|
|
LL | } else falsy! {};
|
|
| ^^^^^ expected `{`
|
|
|
|
|
help: try placing this code inside a block
|
|
|
|
|
LL | } else { falsy! {} };
|
|
| + +
|
|
|
|
error: aborting due to 8 previous errors
|
|
|