diff --git a/src/test/compile-fail/missing-do.rs b/src/test/compile-fail/missing-do.rs new file mode 100644 index 00000000000..5466cbacfa5 --- /dev/null +++ b/src/test/compile-fail/missing-do.rs @@ -0,0 +1,9 @@ +// Regression test for issue #2783 + +fn foo(f: fn()) { f() } + +fn main() { + "" || 42; //! ERROR binary operation || cannot be applied to type `str` + foo || {}; //! ERROR binary operation || cannot be applied to type `extern fn(fn())` + //!^ NOTE did you forget the 'do' keyword for the call? +}