Skip to content

Commit f0beb8c

Browse files
committed
Switch CoherenceInfo from oldmap
1 parent dad5c30 commit f0beb8c

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/librustc/middle/typeck/check/vtable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn lookup_vtable(vcx: &VtableContext,
241241
// Nothing found. Continue.
242242
}
243243
Some(implementations) => {
244-
let implementations: &mut ~[@Impl] = implementations;
244+
let implementations: &mut ~[@Impl] = *implementations;
245245
// implementations is the list of all impls in scope for
246246
// trait_ty. (Usually, there's just one.)
247247
for uint::range(0, implementations.len()) |i| {

src/librustc/middle/typeck/coherence.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use syntax::visit::{visit_mod};
5656
use util::ppaux::ty_to_str;
5757

5858
use core::result::Ok;
59-
use core::hashmap::linear::LinearSet;
59+
use core::hashmap::linear::{LinearMap, LinearSet};
6060
use core::uint;
6161
use std::oldmap::HashMap;
6262

@@ -142,18 +142,17 @@ pub fn method_to_MethodInfo(ast_method: @method) -> @MethodInfo {
142142
pub struct CoherenceInfo {
143143
// Contains implementations of methods that are inherent to a type.
144144
// 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]>,
146146
147147
// Contains implementations of methods associated with a trait. For these,
148148
// 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]>,
151150
}
152151
153152
pub fn CoherenceInfo() -> CoherenceInfo {
154153
CoherenceInfo {
155-
inherent_methods: HashMap(),
156-
extension_methods: HashMap(),
154+
inherent_methods: @mut LinearMap::new(),
155+
extension_methods: @mut LinearMap::new(),
157156
}
158157
}
159158
@@ -380,7 +379,7 @@ pub impl CoherenceChecker {
380379
.insert(base_def_id, implementation_list);
381380
}
382381
Some(existing_implementation_list) => {
383-
implementation_list = existing_implementation_list;
382+
implementation_list = *existing_implementation_list;
384383
}
385384
}
386385

@@ -397,7 +396,7 @@ pub impl CoherenceChecker {
397396
.insert(trait_id, implementation_list);
398397
}
399398
Some(existing_implementation_list) => {
400-
implementation_list = existing_implementation_list;
399+
implementation_list = *existing_implementation_list;
401400
}
402401
}
403402

@@ -472,7 +471,7 @@ pub impl CoherenceChecker {
472471

473472
match extension_methods.find(&trait_def_id) {
474473
Some(impls) => {
475-
let impls: &mut ~[@Impl] = impls;
474+
let impls: &mut ~[@Impl] = *impls;
476475
for uint::range(0, impls.len()) |i| {
477476
f(impls[i]);
478477
}

0 commit comments

Comments
 (0)