2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2015-02-24 23:27:20 -08:00
|
|
|
use std::io::{self, Write};
|
2014-11-07 15:18:08 -05:00
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
fn f(wr: &mut dyn Write) {
|
2015-02-24 23:27:20 -08:00
|
|
|
wr.write_all(b"hello").ok().expect("failed");
|
2014-11-07 15:18:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
2022-07-07 04:36:10 +02:00
|
|
|
let mut wr = Box::new(io::stdout()) as Box<dyn Write>;
|
2014-11-07 15:18:08 -05:00
|
|
|
f(&mut wr);
|
|
|
|
|
}
|