3 use std::io::{stdout, Write, BufWriter};
8 let dest = args.next();
10 let h1; let h2; let h3;
12 let fp: &dyn Write = match dest {
13 Some(path) => { h1 = File::create(path).unwrap(); &h1 },
14 None => { h2 = stdout(); h3 = h2.lock(); &h3 }
17 let fp = BufWriter::new(fp);
18 //~^ ERROR the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
19 //~| ERROR the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
21 writeln!(fp, "hello world").unwrap(); //~ ERROR the method