Skip to content

Commit 6a7fd8c

Browse files
committed
rustdoc: Fix fallout of removing get()
1 parent 0dbb909 commit 6a7fd8c

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/librustdoc/clean.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,16 +1229,15 @@ fn resolve_type(path: Path, tpbs: Option<Vec<TyParamBound> >,
12291229
core::NotTyped(_) => return Bool
12301230
};
12311231
debug!("searching for {:?} in defmap", id);
1232-
let def_map = tycx.def_map.borrow();
1233-
let d = match def_map.get().find(&id) {
1234-
Some(k) => k,
1232+
let d = match tycx.def_map.borrow().find(&id) {
1233+
Some(&k) => k,
12351234
None => {
12361235
debug!("could not find {:?} in defmap (`{}`)", id, tycx.map.node_to_str(id));
12371236
fail!("Unexpected failure: unresolved id not in defmap (this is a bug!)")
12381237
}
12391238
};
12401239

1241-
let (def_id, kind) = match *d {
1240+
let (def_id, kind) = match d {
12421241
ast::DefFn(i, _) => (i, TypeFunction),
12431242
ast::DefSelfTy(i) => return Self(i),
12441243
ast::DefTy(i) => (i, TypeEnum),
@@ -1285,8 +1284,7 @@ fn resolve_def(id: ast::NodeId) -> Option<ast::DefId> {
12851284
let cx = local_data::get(super::ctxtkey, |x| *x.unwrap());
12861285
match cx.maybe_typed {
12871286
core::Typed(ref tcx) => {
1288-
let def_map = tcx.def_map.borrow();
1289-
def_map.get().find(&id).map(|&d| ast_util::def_id_of_def(d))
1287+
tcx.def_map.borrow().find(&id).map(|&d| ast_util::def_id_of_def(d))
12901288
}
12911289
core::NotTyped(_) => None
12921290
}

src/librustdoc/visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a> RustdocVisitor<'a> {
186186
core::Typed(ref tcx) => tcx,
187187
core::NotTyped(_) => return false
188188
};
189-
let def = ast_util::def_id_of_def(*tcx.def_map.borrow().get().get(&id));
189+
let def = ast_util::def_id_of_def(*tcx.def_map.borrow().get(&id));
190190
if !ast_util::is_local(def) { return false }
191191
let analysis = match self.analysis {
192192
Some(analysis) => analysis, None => return false

0 commit comments

Comments
 (0)