Skip to content

Commit f62add9

Browse files
committed
Eliminate an unchecked use of map::get in ppaux
1 parent b722dc3 commit f62add9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/comp/util/ppaux.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ fn fn_ident_to_string(id: ast::node_id, i: &ast::fn_ident) -> istr {
4444

4545
fn get_id_ident(cx: &ctxt, id: ast::def_id) -> istr {
4646
if id.crate != ast::local_crate {
47-
istr::connect(cx.ext_map.get(id), ~"::")
47+
alt cx.ext_map.find(id) {
48+
some(j) { istr::connect(j, ~"::") }
49+
_ { fail ("get_id_ident: can't find item in ext_map, id.crate = "
50+
+ istr::to_estr(int::str(id.crate))) }
51+
}
4852
} else {
4953
alt cx.items.find(id.node) {
5054
some(ast_map::node_item(it)) { it.ident }

0 commit comments

Comments
 (0)