]> git.lizzy.rs Git - rust.git/commitdiff
Fix rustdoc's formatting of lifetimes
authorP1start <rewi-github@whanau.org>
Sun, 15 Jun 2014 02:59:01 +0000 (14:59 +1200)
committerP1start <rewi-github@whanau.org>
Mon, 16 Jun 2014 09:15:48 +0000 (21:15 +1200)
rustdoc was previously formatting lifetimes with two apostrophes, presumably
as a result of #14797.

src/librustdoc/clean/mod.rs
src/librustdoc/html/format.rs

index 7ef1f52c949e527bd716cbcef473be6c1fabb7b6..823e0f6a1b3aeae00fac8bf1d8bf0a41b7a2aa6f 100644 (file)
@@ -617,7 +617,7 @@ fn clean(&self) -> Lifetime {
 impl Clean<Option<Lifetime>> for ty::Region {
     fn clean(&self) -> Option<Lifetime> {
         match *self {
-            ty::ReStatic => Some(Lifetime("static".to_string())),
+            ty::ReStatic => Some(Lifetime("'static".to_string())),
             ty::ReLateBound(_, ty::BrNamed(_, name)) =>
                 Some(Lifetime(token::get_name(name).get().to_string())),
             ty::ReEarlyBound(_, _, _, name) => Some(Lifetime(name.clean())),
index a71f702caca1fac2865aed72469f6f2d819378e7..29d1be888249bb7706f1f1c9e4b907f81c3a91cc 100644 (file)
@@ -91,7 +91,6 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 
 impl fmt::Show for clean::Lifetime {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        try!(f.write("'".as_bytes()));
         try!(f.write(self.get_ref().as_bytes()));
         Ok(())
     }