From 1f80b9b90a4e6143860e514a57d9ee0affbf5015 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 3 Jul 2012 01:32:05 +0100 Subject: [PATCH] Added testcase for the missing do compile note --- src/test/compile-fail/missing-do.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/test/compile-fail/missing-do.rs 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? +}