diff options
Diffstat (limited to 'tests/ui/closures/closure-reform-bad.rs')
-rw-r--r-- | tests/ui/closures/closure-reform-bad.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/closures/closure-reform-bad.rs b/tests/ui/closures/closure-reform-bad.rs new file mode 100644 index 000000000..0ba48ab51 --- /dev/null +++ b/tests/ui/closures/closure-reform-bad.rs @@ -0,0 +1,12 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +fn call_bare(f: fn(&str)) { + f("Hello "); +} + +fn main() { + let string = "world!"; + let f = |s: &str| println!("{}{}", s, string); + call_bare(f) //~ ERROR mismatched types +} |