diff options
Diffstat (limited to 'src/test/ui/expr/if/if-without-block.rs')
| -rw-r--r-- | src/test/ui/expr/if/if-without-block.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/expr/if/if-without-block.rs b/src/test/ui/expr/if/if-without-block.rs new file mode 100644 index 00000000000..8a4c59f3261 --- /dev/null +++ b/src/test/ui/expr/if/if-without-block.rs @@ -0,0 +1,9 @@ +fn main() { + let n = 1; + if 5 == { + //~^ NOTE this `if` expression has a condition, but no block + println!("five"); + } +} +//~^ ERROR expected `{`, found `}` +//~| NOTE expected `{` |
