mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
13 lines
296 B
Rust
13 lines
296 B
Rust
/* 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
|
|
}
|