]> git.lizzy.rs Git - rust.git/blob - tests/target/comment-not-disappear.rs
Merge pull request #757 from ConnorGBrewster/fix-#650
[rust.git] / tests / target / comment-not-disappear.rs
1 // All the comments here should not disappear.
2
3 fn a() {
4     match x {
5         X |
6         // A comment
7         Y => {}
8     };
9 }
10
11 fn b() {
12     match x {
13         X =>
14             // A comment
15             y
16     }
17 }
18
19 fn c() {
20     a() /* ... */;
21 }
22
23 fn foo() -> Vec<i32> {
24     (0..11)
25         .map(|x|
26         // This comment disappears.
27         if x % 2 == 0 { x } else { x * 2 })
28         .collect()
29 }
30
31 fn calc_page_len(prefix_len: usize, sofar: usize) -> usize {
32     2 // page type and flags
33     + 1 // stored depth
34     + 2 // stored count
35     + prefix_len + sofar // sum of size of all the actual items
36 }