about summary refs log tree commit diff
path: root/tests/ui/expr/issue-22933-1.rs
blob: 8f1f5a5048a30e61d549adb47c7402fb53c6f215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ check-pass

struct CNFParser {
    token: char,
}

impl CNFParser {
    fn is_whitespace(c: char) -> bool {
        c == ' ' || c == '\n'
    }

    fn consume_whitespace(&mut self) {
        self.consume_while(&(CNFParser::is_whitespace))
    }

    fn consume_while(&mut self, p: &dyn Fn(char) -> bool) {
        while p(self.token) {
            return
        }
    }
}

fn main() {}