1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 #![allow(unused_must_use, dead_code, deprecated)]
14 use std::io::MemWriter;
18 writer: &'a mut (Writer+'a),
24 impl fmt::Writer for Bar {
25 fn write_str(&mut self, _: &str) -> fmt::Result {
30 fn borrowing_writer_from_struct_and_formatting_struct_field(foo: Foo) {
31 write!(foo.writer, "{}", foo.other);
35 let mut w = MemWriter::new();
36 write!(&mut w as &mut Writer, "");
37 write!(&mut w, ""); // should coerce
43 write!(&mut s, "test");