diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-04-23 23:29:38 -0400 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2014-04-24 11:58:54 +0200 |
| commit | 6fa1f48237bc61cabcb63f75700ad7303f152c1f (patch) | |
| tree | 7392754c0ddb770780e16736c200aa336bdc9122 | |
| parent | 2e358672f8aba3d844df4c744199ace4a309f707 (diff) | |
| download | rust-6fa1f48237bc61cabcb63f75700ad7303f152c1f.tar.gz rust-6fa1f48237bc61cabcb63f75700ad7303f152c1f.zip | |
rustdoc: fix de-@rooting fallout
| -rw-r--r-- | src/libfourcc/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean.rs | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/libfourcc/lib.rs b/src/libfourcc/lib.rs index 50cdd6cedc2..fe0b6bcfd0f 100644 --- a/src/libfourcc/lib.rs +++ b/src/libfourcc/lib.rs @@ -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 { diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index 3f1c99cffd6..be05ccdfcb4 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -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() |
