Introduce TyCtxt::expect_def/expect_resolution helpers and use them where possible
This commit is contained in:
@@ -50,8 +50,8 @@ pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Name>)
|
||||
Some(tcx) => tcx,
|
||||
None => return None,
|
||||
};
|
||||
let def = match tcx.def_map.borrow().get(&id) {
|
||||
Some(d) => d.full_def(),
|
||||
let def = match tcx.expect_def_or_none(id) {
|
||||
Some(def) => def,
|
||||
None => return None,
|
||||
};
|
||||
let did = def.def_id();
|
||||
|
||||
Reference in New Issue
Block a user