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
2fcea9fb68c8e04f10e5cb15bbfb486de9800afa
rust/tests/ui/expr/if/if-without-block.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

8 lines
150 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 == {
Improve parsing errors and suggestions for bad if statements
2022-05-27 21:58:48 -07:00
//~^ ERROR this `if` expression is missing a block after the condition
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");
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3527ms Template: 3ms
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