]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: fix de-@rooting fallout
authorNiko Matsakis <niko@alum.mit.edu>
Thu, 24 Apr 2014 03:29:38 +0000 (23:29 -0400)
committerFlavio Percoco <flaper87@gmail.com>
Thu, 24 Apr 2014 09:58:54 +0000 (11:58 +0200)
src/libfourcc/lib.rs
src/librustdoc/clean.rs

index 50cdd6cedc23c0683dad05e36603db338234e211..fe0b6bcfd0f0afea41e730bcaa0fa77a739551c2 100644 (file)
@@ -91,7 +91,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
 
     let s = match expr.node {
         // expression is a literal
-        ast::ExprLit(lit) => match lit.node {
+        ast::ExprLit(ref lit) => match lit.node {
             // string literal
             ast::LitStr(ref s, _) => {
                 if s.get().char_len() != 4 {
index 3f1c99cffd640228e7948fb8735cf607ae4b6d8c..be05ccdfcb41209576d17ad5cc03afd6d22d20f7 100644 (file)
@@ -684,7 +684,8 @@ impl Clean<Type> for ast::Ty {
     fn clean(&self) -> Type {
         use syntax::ast::*;
         debug!("cleaning type `{:?}`", self);
-        let codemap = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess().codemap();
+        let ctxt = local_data::get(super::ctxtkey, |x| *x.unwrap());
+        let codemap = ctxt.sess().codemap();
         debug!("span corresponds to `{}`", codemap.span_to_str(self.span));
         match self.node {
             TyNil => Unit,
@@ -866,7 +867,8 @@ pub struct Span {
 
 impl Clean<Span> for syntax::codemap::Span {
     fn clean(&self) -> Span {
-        let cm = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess().codemap();
+        let ctxt = local_data::get(super::ctxtkey, |x| *x.unwrap());
+        let cm = ctxt.sess().codemap();
         let filename = cm.span_to_filename(*self);
         let lo = cm.lookup_char_pos(self.lo);
         let hi = cm.lookup_char_pos(self.hi);
@@ -1193,7 +1195,8 @@ trait ToSource {
 impl ToSource for syntax::codemap::Span {
     fn to_src(&self) -> ~str {
         debug!("converting span {:?} to snippet", self.clean());
-        let cm = local_data::get(super::ctxtkey, |x| x.unwrap().clone()).sess().codemap().clone();
+        let ctxt = local_data::get(super::ctxtkey, |x| x.unwrap().clone());
+        let cm = ctxt.sess().codemap().clone();
         let sn = match cm.span_to_snippet(*self) {
             Some(x) => x,
             None    => "".to_owned()