diff options
| author | Flavio Percoco <flaper87@gmail.com> | 2015-01-15 10:09:00 +0100 |
|---|---|---|
| committer | Flavio Percoco <flaper87@gmail.com> | 2015-01-16 08:18:56 +0100 |
| commit | 2adc8b529ada1d697ec51a94164d9b3f66a40b79 (patch) | |
| tree | b372d4d6cedfd55f0a0064cfd0d8e5c095dea48b /src | |
| parent | 59775bb955e7fdb7d1f9cddd27ab64e3676f8e51 (diff) | |
| download | rust-2adc8b529ada1d697ec51a94164d9b3f66a40b79.tar.gz rust-2adc8b529ada1d697ec51a94164d9b3f66a40b79.zip | |
populate impls *before* clonning the impls vec
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/coherence/overlap.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index 159b9d853c4..ce7ba9ac11e 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -39,7 +39,12 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> { // check can populate this table further with impls from other // crates. let trait_def_ids: Vec<(ast::DefId, Vec<ast::DefId>)> = - self.tcx.trait_impls.borrow().iter().map(|(&k, v)| (k, v.borrow().clone())).collect(); + self.tcx.trait_impls.borrow().iter().map(|(&k, v)| { + // FIXME -- it seems like this method actually pushes + // duplicate impls onto the list + ty::populate_implementations_for_trait_if_necessary(self.tcx, k); + (k, v.borrow().clone()) + }).collect(); for &(trait_def_id, ref impls) in trait_def_ids.iter() { self.check_for_overlapping_impls_of_trait(trait_def_id, impls); @@ -53,11 +58,6 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> { debug!("check_for_overlapping_impls_of_trait(trait_def_id={})", trait_def_id.repr(self.tcx)); - // FIXME -- it seems like this method actually pushes - // duplicate impls onto the list - ty::populate_implementations_for_trait_if_necessary(self.tcx, - trait_def_id); - for (i, &impl1_def_id) in trait_impls.iter().enumerate() { if impl1_def_id.krate != ast::LOCAL_CRATE { // we don't need to check impls if both are external; |
