diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-20 21:52:59 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-22 08:48:20 -0700 |
| commit | 6a7fd8cfa59506d70c43b93256c7eeeb79133ca5 (patch) | |
| tree | 36fafc7c803076130a2aeb2403f47e98c1a8b233 | |
| parent | 0dbb909bf7cf557e46748ddcf3cdea916f2734c9 (diff) | |
| download | rust-6a7fd8cfa59506d70c43b93256c7eeeb79133ca5.tar.gz rust-6a7fd8cfa59506d70c43b93256c7eeeb79133ca5.zip | |
rustdoc: Fix fallout of removing get()
| -rw-r--r-- | src/librustdoc/clean.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/librustdoc/clean.rs b/src/librustdoc/clean.rs index e8854215c00..05f6db8cc45 100644 --- a/src/librustdoc/clean.rs +++ b/src/librustdoc/clean.rs @@ -1229,16 +1229,15 @@ fn resolve_type(path: Path, tpbs: Option<Vec<TyParamBound> >, core::NotTyped(_) => return Bool }; debug!("searching for {:?} in defmap", id); - let def_map = tycx.def_map.borrow(); - let d = match def_map.get().find(&id) { - Some(k) => k, + let d = match tycx.def_map.borrow().find(&id) { + Some(&k) => k, None => { debug!("could not find {:?} in defmap (`{}`)", id, tycx.map.node_to_str(id)); fail!("Unexpected failure: unresolved id not in defmap (this is a bug!)") } }; - let (def_id, kind) = match *d { + let (def_id, kind) = match d { ast::DefFn(i, _) => (i, TypeFunction), ast::DefSelfTy(i) => return Self(i), ast::DefTy(i) => (i, TypeEnum), @@ -1285,8 +1284,7 @@ fn resolve_def(id: ast::NodeId) -> Option<ast::DefId> { let cx = local_data::get(super::ctxtkey, |x| *x.unwrap()); match cx.maybe_typed { core::Typed(ref tcx) => { - let def_map = tcx.def_map.borrow(); - def_map.get().find(&id).map(|&d| ast_util::def_id_of_def(d)) + tcx.def_map.borrow().find(&id).map(|&d| ast_util::def_id_of_def(d)) } core::NotTyped(_) => None } diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index df533d882f7..8be3535b3ec 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -186,7 +186,7 @@ impl<'a> RustdocVisitor<'a> { core::Typed(ref tcx) => tcx, core::NotTyped(_) => return false }; - let def = ast_util::def_id_of_def(*tcx.def_map.borrow().get().get(&id)); + let def = ast_util::def_id_of_def(*tcx.def_map.borrow().get(&id)); if !ast_util::is_local(def) { return false } let analysis = match self.analysis { Some(analysis) => analysis, None => return false |
