Skip to content

Commit 1f80b9b

Browse files
mitsuhikobrson
authored andcommitted
Added testcase for the missing do compile note
1 parent 5bd9d6e commit 1f80b9b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/compile-fail/missing-do.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Regression test for issue #2783
2+
3+
fn foo(f: fn()) { f() }
4+
5+
fn main() {
6+
"" || 42; //! ERROR binary operation || cannot be applied to type `str`
7+
foo || {}; //! ERROR binary operation || cannot be applied to type `extern fn(fn())`
8+
//!^ NOTE did you forget the 'do' keyword for the call?
9+
}

0 commit comments

Comments
 (0)