rustc: Make the compiler no longer ICE on unused foreign constants

This commit is contained in:
Patrick Walton 2012-08-30 16:07:55 -07:00
parent 65b05a6ce8
commit 1f056eda8e
2 changed files with 8 additions and 2 deletions

View File

@ -794,7 +794,10 @@ fn trans_foreign_mod(ccx: @crate_ctxt,
}
}
}
ast::foreign_item_const(*) => {}
ast::foreign_item_const(*) => {
let ident = ccx.sess.parse_sess.interner.get(foreign_item.ident);
ccx.item_symbols.insert(foreign_item.id, copy *ident);
}
}
}
}

View File

@ -306,7 +306,10 @@ struct lookup {
};
let trt_methods = ty::trait_methods(tcx, trait_id);
match vec::position(*trt_methods, |m| m.ident == self.m_name) {
let match_fn: &fn(m: ty::method) -> bool = |m| {
m.self_ty != ast::sty_static && m.ident == self.m_name
};
match vec::position(*trt_methods, match_fn) {
None => {
/* check next bound */
trait_bnd_idx += 1u;