diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-22933-1.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-22933-1.rs b/src/test/ui/issues/issue-22933-1.rs new file mode 100644 index 000000000..3c9aa2669 --- /dev/null +++ b/src/test/ui/issues/issue-22933-1.rs @@ -0,0 +1,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() {} |