about summary refs log tree commit diff
path: root/src/libstd/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/macros.rs')
-rw-r--r--src/libstd/macros.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs
index be1fdc4594d..14ae7c9900c 100644
--- a/src/libstd/macros.rs
+++ b/src/libstd/macros.rs
@@ -145,16 +145,18 @@ macro_rules! format(
 
 #[macro_export]
 macro_rules! write(
-    ($dst:expr, $($arg:tt)*) => (
-        format_args!(|args| { ::std::fmt::write($dst, args) }, $($arg)*)
-    )
+    ($dst:expr, $($arg:tt)*) => ({
+        let dst: &mut ::std::io::Writer = $dst;
+        format_args!(|args| { ::std::fmt::write(dst, args) }, $($arg)*)
+    })
 )
 
 #[macro_export]
 macro_rules! writeln(
-    ($dst:expr, $($arg:tt)*) => (
-        format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
-    )
+    ($dst:expr, $($arg:tt)*) => ({
+        let dst: &mut ::std::io::Writer = $dst;
+        format_args!(|args| { ::std::fmt::writeln(dst, args) }, $($arg)*)
+    })
 )
 
 #[macro_export]