@@ -39,7 +39,12 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
39
39
// check can populate this table further with impls from other
40
40
// crates.
41
41
let trait_def_ids: Vec < ( ast:: DefId , Vec < ast:: DefId > ) > =
42
- self . tcx . trait_impls . borrow ( ) . iter ( ) . map ( |( & k, v) | ( k, v. borrow ( ) . clone ( ) ) ) . collect ( ) ;
42
+ self . tcx . trait_impls . borrow ( ) . iter ( ) . map ( |( & k, v) | {
43
+ // FIXME -- it seems like this method actually pushes
44
+ // duplicate impls onto the list
45
+ ty:: populate_implementations_for_trait_if_necessary ( self . tcx , k) ;
46
+ ( k, v. borrow ( ) . clone ( ) )
47
+ } ) . collect ( ) ;
43
48
44
49
for & ( trait_def_id, ref impls) in trait_def_ids. iter ( ) {
45
50
self . check_for_overlapping_impls_of_trait ( trait_def_id, impls) ;
@@ -53,11 +58,6 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
53
58
debug ! ( "check_for_overlapping_impls_of_trait(trait_def_id={})" ,
54
59
trait_def_id. repr( self . tcx) ) ;
55
60
56
- // FIXME -- it seems like this method actually pushes
57
- // duplicate impls onto the list
58
- ty:: populate_implementations_for_trait_if_necessary ( self . tcx ,
59
- trait_def_id) ;
60
-
61
61
for ( i, & impl1_def_id) in trait_impls. iter ( ) . enumerate ( ) {
62
62
if impl1_def_id. krate != ast:: LOCAL_CRATE {
63
63
// we don't need to check impls if both are external;
0 commit comments