rust/tests/source/issue-4120.rs
WhizSid faf97a67d6 Fixed 'Incorrect comment indent inside if/else' issue. (#4459)
* Added test cases

* Fixed if condition comment issue

* Fixed extern C issue

* Removed previous test case

* Removed tmp file

* honor the authors intent

* Changed the file name to its original name

* Removed extra whitespace
2020-11-14 11:50:28 -06:00

85 lines
1 KiB
Rust

fn main() {
let x = if true {
1
// In if
} else {
0
// In else
};
let x = if true {
1
/* In if */
} else {
0
/* In else */
};
let z = if true {
if true {
1
// In if level 2
} else {
2
}
} else {
3
};
let a = if true {
1
// In if
} else {
0
// In else
};
let a = if true {
1
// In if
} else {
0
// In else
};
let b = if true {
1
// In if
} else {
0
// In else
};
let c = if true {
1
// In if
} else {
0
// In else
};
for i in 0..2 {
println!("Something");
// In for
}
for i in 0..2 {
println!("Something");
/* In for */
}
extern "C" {
fn first();
// In foreign mod
}
extern "C" {
fn first();
/* In foreign mod */
}
}