Added testcase for the missing do compile note
This commit is contained in:
parent
5bd9d6e05c
commit
1f80b9b90a
9
src/test/compile-fail/missing-do.rs
Normal file
9
src/test/compile-fail/missing-do.rs
Normal file
@ -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?
|
||||
}
|
Loading…
Reference in New Issue
Block a user