}
}
+ pub fn from_builtin_kind(&self, bound: ty::BuiltinBound)
+ -> Result<ast::DefId, String>
+ {
+ match bound {
+ ty::BoundSend => self.require(SendTraitLangItem),
+ ty::BoundSized => self.require(SizedTraitLangItem),
+ ty::BoundCopy => self.require(CopyTraitLangItem),
+ ty::BoundSync => self.require(SyncTraitLangItem),
+ }
+ }
+
pub fn to_builtin_kind(&self, id: ast::DefId) -> Option<ty::BuiltinBound> {
if Some(id) == self.send_trait() {
Some(ty::BoundSend)
item_refs: HashMap<&'static str, uint>,
}
-impl<'a> Visitor for LanguageItemCollector<'a> {
+impl<'a, 'v> Visitor<'v> for LanguageItemCollector<'a> {
fn visit_item(&mut self, item: &ast::Item) {
match extract(item.attrs.as_slice()) {
Some(value) => {
ShrTraitLangItem, "shr", shr_trait;
IndexTraitLangItem, "index", index_trait;
IndexMutTraitLangItem, "index_mut", index_mut_trait;
+ SliceTraitLangItem, "slice", slice_trait;
+ SliceMutTraitLangItem, "slice_mut", slice_mut_trait;
UnsafeTypeLangItem, "unsafe", unsafe_type;
BeginUnwindLangItem, "begin_unwind", begin_unwind;
ExchangeMallocFnLangItem, "exchange_malloc", exchange_malloc_fn;
- ClosureExchangeMallocFnLangItem, "closure_exchange_malloc", closure_exchange_malloc_fn;
ExchangeFreeFnLangItem, "exchange_free", exchange_free_fn;
MallocFnLangItem, "malloc", malloc_fn;
FreeFnLangItem, "free", free_fn;