about summary refs log tree commit diff
path: root/src/librustdoc/clean.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-11-01 18:06:31 -0700
committerBrian Anderson <banderson@mozilla.com>2014-01-04 14:44:12 -0800
commit3b1862a82f04f8f5bcb197715d2ff506c6cdecc3 (patch)
tree0057a02e6d56e9bea0357d649a420b6e66b5be71 /src/librustdoc/clean.rs
parent18cef3fad47f90c6c5ec1f2ad4dbc12b86b7ee7e (diff)
downloadrust-3b1862a82f04f8f5bcb197715d2ff506c6cdecc3.tar.gz
rust-3b1862a82f04f8f5bcb197715d2ff506c6cdecc3.zip
Don't allow newtype structs to be dereferenced. #6246
Diffstat (limited to 'src/librustdoc/clean.rs')
-rw-r--r--src/librustdoc/clean.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs
index 52dbba13ea8..ad7fcd6b0c8 100644
--- a/src/librustdoc/clean.rs
+++ b/src/librustdoc/clean.rs
@@ -19,6 +19,7 @@ use syntax::ast_map;
 use syntax::ast_util;
 use syntax::attr;
 use syntax::attr::AttributeMethods;
+use syntax::codemap::Pos;
 
 use rustc::metadata::cstore;
 use rustc::metadata::csearch;
@@ -289,6 +290,14 @@ impl Clean<TyParamBound> for ast::TyParamBound {
 #[deriving(Clone, Encodable, Decodable)]
 pub struct Lifetime(~str);
 
+impl Lifetime {
+    pub fn get_ref<'a>(&'a self) -> &'a str {
+        let Lifetime(ref s) = *self;
+        let s: &'a str = *s;
+        return s;
+    }
+}
+
 impl Clean<Lifetime> for ast::Lifetime {
     fn clean(&self) -> Lifetime {
         Lifetime(self.ident.clean())
@@ -798,9 +807,9 @@ impl Clean<Span> for syntax::codemap::Span {
         Span {
             filename: filename.to_owned(),
             loline: lo.line,
-            locol: *lo.col,
+            locol: lo.col.to_uint(),
             hiline: hi.line,
-            hicol: *hi.col,
+            hicol: hi.col.to_uint(),
         }
     }
 }