Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
3bdec3c8abdc48e46715d7b14b764af28da1cee3
rust/src/test/ui/expr/if/if-without-block.rs

10 lines
198 B
Rust
Raw Normal View History

Detect missing `if` blocks When unnecessarily using a fat arrow after an if condition, suggest the removal of it. When finding an if statement with no block, point at the `if` keyword to provide more context.
2018-02-18 16:59:33 -08:00
fn main() {
let n = 1;
if 5 == {
more recovery in if-parsing
2019-12-06 23:23:30 +01:00
//~^ NOTE this `if` expression has a condition, but no block
Detect missing `if` blocks When unnecessarily using a fat arrow after an if condition, suggest the removal of it. When finding an if statement with no block, point at the `if` keyword to provide more context.
2018-02-18 16:59:33 -08:00
println!("five");
}
}
//~^ ERROR expected `{`, found `}`
Use token description in "expected/found" parse messages
2018-10-28 16:05:07 -07:00
//~| NOTE expected `{`
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1883ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API