@@ -298,7 +298,7 @@ struct LanguageItemCollector<'self> {
298
298
crate : & ' self Crate ,
299
299
session : Session ,
300
300
301
- item_refs : HashMap < @ str , uint > ,
301
+ item_refs : HashMap < & ' static str , uint > ,
302
302
}
303
303
304
304
struct LanguageItemVisitor < ' self > {
@@ -327,51 +327,51 @@ impl<'self> LanguageItemCollector<'self> {
327
327
-> LanguageItemCollector < ' a > {
328
328
let mut item_refs = HashMap :: new ( ) ;
329
329
330
- item_refs. insert ( @ "freeze", FreezeTraitLangItem as uint ) ;
331
- item_refs. insert ( @ "send", SendTraitLangItem as uint ) ;
332
- item_refs. insert ( @ "sized", SizedTraitLangItem as uint ) ;
333
-
334
- item_refs. insert ( @ "drop", DropTraitLangItem as uint ) ;
335
-
336
- item_refs. insert ( @ "add", AddTraitLangItem as uint ) ;
337
- item_refs. insert ( @ "sub", SubTraitLangItem as uint ) ;
338
- item_refs. insert ( @ "mul", MulTraitLangItem as uint ) ;
339
- item_refs. insert ( @ "div", DivTraitLangItem as uint ) ;
340
- item_refs. insert ( @ "rem", RemTraitLangItem as uint ) ;
341
- item_refs. insert ( @ "neg", NegTraitLangItem as uint ) ;
342
- item_refs. insert ( @ "not", NotTraitLangItem as uint ) ;
343
- item_refs. insert ( @ "bitxor", BitXorTraitLangItem as uint ) ;
344
- item_refs. insert ( @ "bitand", BitAndTraitLangItem as uint ) ;
345
- item_refs. insert ( @ "bitor", BitOrTraitLangItem as uint ) ;
346
- item_refs. insert ( @ "shl", ShlTraitLangItem as uint ) ;
347
- item_refs. insert ( @ "shr", ShrTraitLangItem as uint ) ;
348
- item_refs. insert ( @ "index", IndexTraitLangItem as uint ) ;
349
-
350
- item_refs. insert ( @ "eq", EqTraitLangItem as uint ) ;
351
- item_refs. insert ( @ "ord", OrdTraitLangItem as uint ) ;
352
-
353
- item_refs. insert ( @ "str_eq", StrEqFnLangItem as uint ) ;
354
- item_refs. insert ( @ "uniq_str_eq", UniqStrEqFnLangItem as uint ) ;
355
- item_refs. insert ( @ "fail_", FailFnLangItem as uint ) ;
356
- item_refs. insert ( @ "fail_bounds_check",
330
+ item_refs. insert ( "freeze" , FreezeTraitLangItem as uint ) ;
331
+ item_refs. insert ( "send" , SendTraitLangItem as uint ) ;
332
+ item_refs. insert ( "sized" , SizedTraitLangItem as uint ) ;
333
+
334
+ item_refs. insert ( "drop" , DropTraitLangItem as uint ) ;
335
+
336
+ item_refs. insert ( "add" , AddTraitLangItem as uint ) ;
337
+ item_refs. insert ( "sub" , SubTraitLangItem as uint ) ;
338
+ item_refs. insert ( "mul" , MulTraitLangItem as uint ) ;
339
+ item_refs. insert ( "div" , DivTraitLangItem as uint ) ;
340
+ item_refs. insert ( "rem" , RemTraitLangItem as uint ) ;
341
+ item_refs. insert ( "neg" , NegTraitLangItem as uint ) ;
342
+ item_refs. insert ( "not" , NotTraitLangItem as uint ) ;
343
+ item_refs. insert ( "bitxor" , BitXorTraitLangItem as uint ) ;
344
+ item_refs. insert ( "bitand" , BitAndTraitLangItem as uint ) ;
345
+ item_refs. insert ( "bitor" , BitOrTraitLangItem as uint ) ;
346
+ item_refs. insert ( "shl" , ShlTraitLangItem as uint ) ;
347
+ item_refs. insert ( "shr" , ShrTraitLangItem as uint ) ;
348
+ item_refs. insert ( "index" , IndexTraitLangItem as uint ) ;
349
+
350
+ item_refs. insert ( "eq" , EqTraitLangItem as uint ) ;
351
+ item_refs. insert ( "ord" , OrdTraitLangItem as uint ) ;
352
+
353
+ item_refs. insert ( "str_eq" , StrEqFnLangItem as uint ) ;
354
+ item_refs. insert ( "uniq_str_eq" , UniqStrEqFnLangItem as uint ) ;
355
+ item_refs. insert ( "fail_" , FailFnLangItem as uint ) ;
356
+ item_refs. insert ( "fail_bounds_check" ,
357
357
FailBoundsCheckFnLangItem as uint ) ;
358
- item_refs. insert ( @ "exchange_malloc", ExchangeMallocFnLangItem as uint ) ;
359
- item_refs. insert ( @ "closure_exchange_malloc", ClosureExchangeMallocFnLangItem as uint ) ;
360
- item_refs. insert ( @ "exchange_free", ExchangeFreeFnLangItem as uint ) ;
361
- item_refs. insert ( @ "malloc", MallocFnLangItem as uint ) ;
362
- item_refs. insert ( @ "free", FreeFnLangItem as uint ) ;
363
- item_refs. insert ( @ "borrow_as_imm", BorrowAsImmFnLangItem as uint ) ;
364
- item_refs. insert ( @ "borrow_as_mut", BorrowAsMutFnLangItem as uint ) ;
365
- item_refs. insert ( @ "return_to_mut", ReturnToMutFnLangItem as uint ) ;
366
- item_refs. insert ( @ "check_not_borrowed",
358
+ item_refs. insert ( "exchange_malloc" , ExchangeMallocFnLangItem as uint ) ;
359
+ item_refs. insert ( "closure_exchange_malloc" , ClosureExchangeMallocFnLangItem as uint ) ;
360
+ item_refs. insert ( "exchange_free" , ExchangeFreeFnLangItem as uint ) ;
361
+ item_refs. insert ( "malloc" , MallocFnLangItem as uint ) ;
362
+ item_refs. insert ( "free" , FreeFnLangItem as uint ) ;
363
+ item_refs. insert ( "borrow_as_imm" , BorrowAsImmFnLangItem as uint ) ;
364
+ item_refs. insert ( "borrow_as_mut" , BorrowAsMutFnLangItem as uint ) ;
365
+ item_refs. insert ( "return_to_mut" , ReturnToMutFnLangItem as uint ) ;
366
+ item_refs. insert ( "check_not_borrowed" ,
367
367
CheckNotBorrowedFnLangItem as uint ) ;
368
- item_refs. insert ( @ "strdup_uniq", StrDupUniqFnLangItem as uint ) ;
369
- item_refs. insert ( @ "record_borrow", RecordBorrowFnLangItem as uint ) ;
370
- item_refs. insert ( @ "unrecord_borrow", UnrecordBorrowFnLangItem as uint ) ;
371
- item_refs. insert ( @ "start", StartFnLangItem as uint ) ;
372
- item_refs. insert ( @ "ty_desc", TyDescStructLangItem as uint ) ;
373
- item_refs. insert ( @ "ty_visitor", TyVisitorTraitLangItem as uint ) ;
374
- item_refs. insert ( @ "opaque", OpaqueStructLangItem as uint ) ;
368
+ item_refs. insert ( "strdup_uniq" , StrDupUniqFnLangItem as uint ) ;
369
+ item_refs. insert ( "record_borrow" , RecordBorrowFnLangItem as uint ) ;
370
+ item_refs. insert ( "unrecord_borrow" , UnrecordBorrowFnLangItem as uint ) ;
371
+ item_refs. insert ( "start" , StartFnLangItem as uint ) ;
372
+ item_refs. insert ( "ty_desc" , TyDescStructLangItem as uint ) ;
373
+ item_refs. insert ( "ty_visitor" , TyVisitorTraitLangItem as uint ) ;
374
+ item_refs. insert ( "opaque" , OpaqueStructLangItem as uint ) ;
375
375
376
376
LanguageItemCollector {
377
377
crate: crate ,
@@ -416,8 +416,8 @@ impl<'self> LanguageItemCollector<'self> {
416
416
return ; // Didn't match.
417
417
}
418
418
419
- let item_index = self . item_refs . find ( & value) . map_move ( |x| * x) ;
420
- // prevent borrow checker from considering ^~~~~~~~~~~
419
+ let item_index = self . item_refs . find_equiv ( & value) . map_move ( |x| * x) ;
420
+ // prevent borrow checker from considering ^~~~~~~~~~~
421
421
// self to be borrowed (annoying)
422
422
423
423
match item_index {
0 commit comments