@@ -56,7 +56,7 @@ use syntax::visit::{visit_mod};
56
56
use util:: ppaux:: ty_to_str;
57
57
58
58
use core:: result:: Ok ;
59
- use core:: hashmap:: linear:: LinearSet ;
59
+ use core:: hashmap:: linear:: { LinearMap , LinearSet } ;
60
60
use core:: uint;
61
61
use std:: oldmap:: HashMap ;
62
62
@@ -142,18 +142,17 @@ pub fn method_to_MethodInfo(ast_method: @method) -> @MethodInfo {
142
142
pub struct CoherenceInfo {
143
143
// Contains implementations of methods that are inherent to a type.
144
144
// Methods in these implementations don't need to be exported.
145
- inherent_methods: HashMap <def_id,@mut ~[@Impl]>,
145
+ inherent_methods: @mut LinearMap <def_id, @mut ~[@Impl]>,
146
146
147
147
// Contains implementations of methods associated with a trait. For these,
148
148
// the associated trait must be imported at the call site.
149
- extension_methods: HashMap<def_id,@mut ~[@Impl]>,
150
-
149
+ extension_methods: @mut LinearMap<def_id, @mut ~[@Impl]>,
151
150
}
152
151
153
152
pub fn CoherenceInfo() -> CoherenceInfo {
154
153
CoherenceInfo {
155
- inherent_methods: HashMap (),
156
- extension_methods: HashMap (),
154
+ inherent_methods: @mut LinearMap::new (),
155
+ extension_methods: @mut LinearMap::new (),
157
156
}
158
157
}
159
158
@@ -380,7 +379,7 @@ pub impl CoherenceChecker {
380
379
. insert ( base_def_id, implementation_list) ;
381
380
}
382
381
Some ( existing_implementation_list) => {
383
- implementation_list = existing_implementation_list;
382
+ implementation_list = * existing_implementation_list;
384
383
}
385
384
}
386
385
@@ -397,7 +396,7 @@ pub impl CoherenceChecker {
397
396
. insert ( trait_id, implementation_list) ;
398
397
}
399
398
Some ( existing_implementation_list) => {
400
- implementation_list = existing_implementation_list;
399
+ implementation_list = * existing_implementation_list;
401
400
}
402
401
}
403
402
@@ -472,7 +471,7 @@ pub impl CoherenceChecker {
472
471
473
472
match extension_methods. find( & trait_def_id) {
474
473
Some ( impls) => {
475
- let impls: & mut ~[ @Impl ] = impls;
474
+ let impls: & mut ~[ @Impl ] = * impls;
476
475
for uint:: range( 0 , impls. len( ) ) |i| {
477
476
f( impls[ i] ) ;
478
477
}
0 commit comments