4fc0452ace
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
14 lines
298 B
Rust
14 lines
298 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: |&str| = |s| println!("{}", s + string);
|
|
call_bare(f) //~ ERROR mismatched types
|
|
}
|
|
|