diff options
| author | bors <bors@rust-lang.org> | 2014-07-16 02:11:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-16 02:11:14 +0000 |
| commit | c523d86552d6797ad52acece4e2e65cb319ee4f2 (patch) | |
| tree | 2fc16da524e27fcdbe9434b300bf535ad775155c /src/libsyntax/owned_slice.rs | |
| parent | afbcbbc77ffc6b10053bc543daf7d2e05d68cc01 (diff) | |
| parent | 446f9373c05900125f30f244441c5833ce64e146 (diff) | |
auto merge of #15585 : bgamari/rust/subst-bug, r=pnkfelix
This branch has a fix for #15557 (a2bcef9) as well as a variety of patches I found useful while debugging this issue. These include adding `Show` impls to a variety of types, including the majority of `syntax::ast` and some of `middle::ty`.
Diffstat (limited to 'src/libsyntax/owned_slice.rs')
| -rw-r--r-- | src/libsyntax/owned_slice.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libsyntax/owned_slice.rs b/src/libsyntax/owned_slice.rs index 530ea013112..7eb6709919a 100644 --- a/src/libsyntax/owned_slice.rs +++ b/src/libsyntax/owned_slice.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::fmt; use std::default::Default; use std::hash; use std::{mem, raw, ptr, slice}; @@ -22,6 +23,17 @@ pub struct OwnedSlice<T> { len: uint, } +impl<T:fmt::Show> fmt::Show for OwnedSlice<T> { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + try!("OwnedSlice {{".fmt(fmt)); + for i in self.iter() { + try!(i.fmt(fmt)); + } + try!("}}".fmt(fmt)); + Ok(()) + } +} + #[unsafe_destructor] impl<T> Drop for OwnedSlice<T> { fn drop(&mut self) { |
