@@ -256,45 +256,46 @@ fn LanguageItemCollector(crate: @crate,
256
256
-> LanguageItemCollector /& r {
257
257
let item_refs = HashMap ( ) ;
258
258
259
- item_refs. insert ( ~"const ", ConstTraitLangItem as uint ) ;
260
- item_refs. insert ( ~"copy", CopyTraitLangItem as uint ) ;
261
- item_refs. insert ( ~"owned", OwnedTraitLangItem as uint ) ;
262
- item_refs. insert ( ~"durable", DurableTraitLangItem as uint ) ;
263
-
264
- item_refs. insert ( ~"drop", DropTraitLangItem as uint ) ;
265
-
266
- item_refs. insert ( ~"add", AddTraitLangItem as uint ) ;
267
- item_refs. insert ( ~"sub", SubTraitLangItem as uint ) ;
268
- item_refs. insert ( ~"mul", MulTraitLangItem as uint ) ;
269
- item_refs. insert ( ~"div", DivTraitLangItem as uint ) ;
270
- item_refs. insert ( ~"modulo", ModuloTraitLangItem as uint ) ;
271
- item_refs. insert ( ~"neg", NegTraitLangItem as uint ) ;
272
- item_refs. insert ( ~"not", NotTraitLangItem as uint ) ;
273
- item_refs. insert ( ~"bitxor", BitXorTraitLangItem as uint ) ;
274
- item_refs. insert ( ~"bitand", BitAndTraitLangItem as uint ) ;
275
- item_refs. insert ( ~"bitor", BitOrTraitLangItem as uint ) ;
276
- item_refs. insert ( ~"shl", ShlTraitLangItem as uint ) ;
277
- item_refs. insert ( ~"shr", ShrTraitLangItem as uint ) ;
278
- item_refs. insert ( ~"index", IndexTraitLangItem as uint ) ;
279
-
280
- item_refs. insert ( ~"eq", EqTraitLangItem as uint ) ;
281
- item_refs. insert ( ~"ord", OrdTraitLangItem as uint ) ;
282
-
283
- item_refs. insert ( ~"str_eq", StrEqFnLangItem as uint ) ;
284
- item_refs. insert ( ~"uniq_str_eq", UniqStrEqFnLangItem as uint ) ;
285
- item_refs. insert ( ~"annihilate", AnnihilateFnLangItem as uint ) ;
286
- item_refs. insert ( ~"log_type", LogTypeFnLangItem as uint ) ;
287
- item_refs. insert ( ~"fail_", FailFnLangItem as uint ) ;
288
- item_refs. insert ( ~"fail_bounds_check", FailBoundsCheckFnLangItem as uint ) ;
289
- item_refs. insert ( ~"exchange_malloc", ExchangeMallocFnLangItem as uint ) ;
290
- item_refs. insert ( ~"exchange_free", ExchangeFreeFnLangItem as uint ) ;
291
- item_refs. insert ( ~"malloc", MallocFnLangItem as uint ) ;
292
- item_refs. insert ( ~"free", FreeFnLangItem as uint ) ;
293
- item_refs. insert ( ~"borrow_as_imm", BorrowAsImmFnLangItem as uint ) ;
294
- item_refs. insert ( ~"return_to_mut", ReturnToMutFnLangItem as uint ) ;
295
- item_refs. insert ( ~"check_not_borrowed",
259
+ item_refs. insert ( @~"const ", ConstTraitLangItem as uint ) ;
260
+ item_refs. insert ( @~"copy", CopyTraitLangItem as uint ) ;
261
+ item_refs. insert ( @~"owned", OwnedTraitLangItem as uint ) ;
262
+ item_refs. insert ( @~"durable", DurableTraitLangItem as uint ) ;
263
+
264
+ item_refs. insert ( @~"drop", DropTraitLangItem as uint ) ;
265
+
266
+ item_refs. insert ( @~"add", AddTraitLangItem as uint ) ;
267
+ item_refs. insert ( @~"sub", SubTraitLangItem as uint ) ;
268
+ item_refs. insert ( @~"mul", MulTraitLangItem as uint ) ;
269
+ item_refs. insert ( @~"div", DivTraitLangItem as uint ) ;
270
+ item_refs. insert ( @~"modulo", ModuloTraitLangItem as uint ) ;
271
+ item_refs. insert ( @~"neg", NegTraitLangItem as uint ) ;
272
+ item_refs. insert ( @~"not", NotTraitLangItem as uint ) ;
273
+ item_refs. insert ( @~"bitxor", BitXorTraitLangItem as uint ) ;
274
+ item_refs. insert ( @~"bitand", BitAndTraitLangItem as uint ) ;
275
+ item_refs. insert ( @~"bitor", BitOrTraitLangItem as uint ) ;
276
+ item_refs. insert ( @~"shl", ShlTraitLangItem as uint ) ;
277
+ item_refs. insert ( @~"shr", ShrTraitLangItem as uint ) ;
278
+ item_refs. insert ( @~"index", IndexTraitLangItem as uint ) ;
279
+
280
+ item_refs. insert ( @~"eq", EqTraitLangItem as uint ) ;
281
+ item_refs. insert ( @~"ord", OrdTraitLangItem as uint ) ;
282
+
283
+ item_refs. insert ( @~"str_eq", StrEqFnLangItem as uint ) ;
284
+ item_refs. insert ( @~"uniq_str_eq", UniqStrEqFnLangItem as uint ) ;
285
+ item_refs. insert ( @~"annihilate", AnnihilateFnLangItem as uint ) ;
286
+ item_refs. insert ( @~"log_type", LogTypeFnLangItem as uint ) ;
287
+ item_refs. insert ( @~"fail_", FailFnLangItem as uint ) ;
288
+ item_refs. insert ( @~"fail_bounds_check",
289
+ FailBoundsCheckFnLangItem as uint ) ;
290
+ item_refs. insert ( @~"exchange_malloc", ExchangeMallocFnLangItem as uint ) ;
291
+ item_refs. insert ( @~"exchange_free", ExchangeFreeFnLangItem as uint ) ;
292
+ item_refs. insert ( @~"malloc", MallocFnLangItem as uint ) ;
293
+ item_refs. insert ( @~"free", FreeFnLangItem as uint ) ;
294
+ item_refs. insert ( @~"borrow_as_imm", BorrowAsImmFnLangItem as uint ) ;
295
+ item_refs. insert ( @~"return_to_mut", ReturnToMutFnLangItem as uint ) ;
296
+ item_refs. insert ( @~"check_not_borrowed",
296
297
CheckNotBorrowedFnLangItem as uint ) ;
297
- item_refs. insert ( ~"strdup_uniq", StrDupUniqFnLangItem as uint ) ;
298
+ item_refs. insert ( @ ~"strdup_uniq", StrDupUniqFnLangItem as uint ) ;
298
299
299
300
LanguageItemCollector {
300
301
crate: crate ,
@@ -310,19 +311,17 @@ struct LanguageItemCollector {
310
311
crate : @crate ,
311
312
session : Session ,
312
313
313
- item_refs : HashMap < ~str , uint > ,
314
+ item_refs : HashMap < @ ~str , uint > ,
314
315
}
315
316
316
317
impl LanguageItemCollector {
317
318
fn match_and_collect_meta_item ( item_def_id : def_id ,
318
319
meta_item : meta_item ) {
319
320
match meta_item. node {
320
- meta_name_value( ref key, literal) => {
321
+ meta_name_value( key, literal) => {
321
322
match literal. node {
322
323
lit_str( value) => {
323
- self . match_and_collect_item ( item_def_id,
324
- ( /*bad*/ copy * * key) ,
325
- /*bad*/ copy * value) ;
324
+ self . match_and_collect_item ( item_def_id, key, value) ;
326
325
}
327
326
_ => { } // Skip.
328
327
}
@@ -347,8 +346,8 @@ impl LanguageItemCollector {
347
346
self . items . items [ item_index] = Some ( item_def_id) ;
348
347
}
349
348
350
- fn match_and_collect_item ( item_def_id : def_id , key : ~str , value : ~str ) {
351
- if key != ~"lang" {
349
+ fn match_and_collect_item ( item_def_id : def_id , key : @ ~str , value : @ ~str ) {
350
+ if * key != ~"lang" {
352
351
return ; // Didn't match.
353
352
}
354
353
@@ -394,7 +393,7 @@ impl LanguageItemCollector {
394
393
for self . item_refs. each |& key, & item_ref| {
395
394
match self . items . items [ item_ref] {
396
395
None => {
397
- self . session . err ( fmt ! ( "no item found for `%s`" , key) ) ;
396
+ self . session . err ( fmt ! ( "no item found for `%s`" , * key) ) ;
398
397
}
399
398
Some ( _) => {
400
399
// OK.
0 commit comments