about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-04-13 15:51:46 -0700
committerbors <bors@rust-lang.org>2014-04-13 15:51:46 -0700
commit5d284a0daa39f6b87028f97b5bfa2bb92f658f83 (patch)
tree9e9ba17ab43584e0a026f67fd8435cf6b0d063ff /src/libstd
parent296e60be6b027a52de58251848037a92f23a0878 (diff)
parent44e34c24c4752408038f95225f536d11605c5ba4 (diff)
downloadrust-5d284a0daa39f6b87028f97b5bfa2bb92f658f83.tar.gz
rust-5d284a0daa39f6b87028f97b5bfa2bb92f658f83.zip
auto merge of #13464 : alexcrichton/rust/fix-rustdoc-rendering, r=brson
Closures did not have their bounds printed at all, nor their lifetimes. Trait
bounds were also printed in angle brackets rather than after a colon with a '+'
inbetween them.

Note that on the current task::spawn [1] documentation page, there is no mention
of a `Send` bound even though it is crucially important!

[1] - http://static.rust-lang.org/doc/master/std/task/fn.task.html
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/slice.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstd/slice.rs b/src/libstd/slice.rs
index 28c5b56a7a7..aedaa5b3c15 100644
--- a/src/libstd/slice.rs
+++ b/src/libstd/slice.rs
@@ -2601,7 +2601,9 @@ impl<A: Clone> Clone for ~[A] {
 
 impl<'a, T: fmt::Show> fmt::Show for &'a [T] {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        try!(write!(f.buf, "["));
+        if f.flags & (1 << (fmt::parse::FlagAlternate as uint)) == 0 {
+            try!(write!(f.buf, "["));
+        }
         let mut is_first = true;
         for x in self.iter() {
             if is_first {
@@ -2611,7 +2613,10 @@ impl<'a, T: fmt::Show> fmt::Show for &'a [T] {
             }
             try!(write!(f.buf, "{}", *x))
         }
-        write!(f.buf, "]")
+        if f.flags & (1 << (fmt::parse::FlagAlternate as uint)) == 0 {
+            try!(write!(f.buf, "]"));
+        }
+        Ok(())
     }
 }