diff options
| author | Chris Wong <lambda.fairy@gmail.com> | 2015-04-01 19:48:49 +1300 |
|---|---|---|
| committer | Chris Wong <lambda.fairy@gmail.com> | 2015-04-01 19:48:49 +1300 |
| commit | 7c3efcc5bb260234fc163340c9fd7aad3d8d780e (patch) | |
| tree | 30ae61277d1f2b5d2e59fde5dd481b72c96b2a26 | |
| parent | d754722a04b99fdcae0fd97fa2a4395521145ef2 (diff) | |
| download | rust-7c3efcc5bb260234fc163340c9fd7aad3d8d780e.tar.gz rust-7c3efcc5bb260234fc163340c9fd7aad3d8d780e.zip | |
Don't reborrow the target of a `write!()`
This means passing in e.g. a `Vec<u8>` or `String` will work as intended, rather than deref-ing to `&mut [u8]` or `&mut str`. [breaking-change] Closes #23768
| -rw-r--r-- | src/libcore/macros.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index d5a7c1d6b26..e867ed3efd9 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -184,7 +184,7 @@ macro_rules! try { /// ``` #[macro_export] macro_rules! write { - ($dst:expr, $($arg:tt)*) => ((&mut *$dst).write_fmt(format_args!($($arg)*))) + ($dst:expr, $($arg:tt)*) => ($dst.write_fmt(format_args!($($arg)*))) } /// Equivalent to the `write!` macro, except that a newline is appended after |
