Skip to content

Commit 6fa1f48

Browse files
nikomatsakisflaper87
authored andcommitted
rustdoc: fix de-@rooting fallout
1 parent 2e35867 commit 6fa1f48

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/libfourcc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
9191

9292
let s = match expr.node {
9393
// expression is a literal
94-
ast::ExprLit(lit) => match lit.node {
94+
ast::ExprLit(ref lit) => match lit.node {
9595
// string literal
9696
ast::LitStr(ref s, _) => {
9797
if s.get().char_len() != 4 {

src/librustdoc/clean.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,8 @@ impl Clean<Type> for ast::Ty {
684684
fn clean(&self) -> Type {
685685
use syntax::ast::*;
686686
debug!("cleaning type `{:?}`", self);
687-
let codemap = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess().codemap();
687+
let ctxt = local_data::get(super::ctxtkey, |x| *x.unwrap());
688+
let codemap = ctxt.sess().codemap();
688689
debug!("span corresponds to `{}`", codemap.span_to_str(self.span));
689690
match self.node {
690691
TyNil => Unit,
@@ -866,7 +867,8 @@ pub struct Span {
866867

867868
impl Clean<Span> for syntax::codemap::Span {
868869
fn clean(&self) -> Span {
869-
let cm = local_data::get(super::ctxtkey, |x| *x.unwrap()).sess().codemap();
870+
let ctxt = local_data::get(super::ctxtkey, |x| *x.unwrap());
871+
let cm = ctxt.sess().codemap();
870872
let filename = cm.span_to_filename(*self);
871873
let lo = cm.lookup_char_pos(self.lo);
872874
let hi = cm.lookup_char_pos(self.hi);
@@ -1193,7 +1195,8 @@ trait ToSource {
11931195
impl ToSource for syntax::codemap::Span {
11941196
fn to_src(&self) -> ~str {
11951197
debug!("converting span {:?} to snippet", self.clean());
1196-
let cm = local_data::get(super::ctxtkey, |x| x.unwrap().clone()).sess().codemap().clone();
1198+
let ctxt = local_data::get(super::ctxtkey, |x| x.unwrap().clone());
1199+
let cm = ctxt.sess().codemap().clone();
11971200
let sn = match cm.span_to_snippet(*self) {
11981201
Some(x) => x,
11991202
None => "".to_owned()

0 commit comments

Comments
 (0)