diff options
| author | bors <bors@rust-lang.org> | 2014-04-13 15:51:46 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-04-13 15:51:46 -0700 |
| commit | 5d284a0daa39f6b87028f97b5bfa2bb92f658f83 (patch) | |
| tree | 9e9ba17ab43584e0a026f67fd8435cf6b0d063ff /src/libstd | |
| parent | 296e60be6b027a52de58251848037a92f23a0878 (diff) | |
| parent | 44e34c24c4752408038f95225f536d11605c5ba4 (diff) | |
| download | rust-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.rs | 9 |
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(()) } } |
