]> git.lizzy.rs Git - rust.git/commitdiff
Correctly populate trait impl map when checking for impl overlaps
authorBrian Koropoff <bkoropoff@gmail.com>
Sun, 28 Sep 2014 21:17:22 +0000 (14:17 -0700)
committerBrian Koropoff <bkoropoff@gmail.com>
Sun, 28 Sep 2014 21:28:48 +0000 (14:28 -0700)
Also fix an existing compile-fail test which was intended to cover
this case.

This closes issue #17593

src/librustc/middle/typeck/coherence/overlap.rs
src/test/compile-fail/conflicting-implementations-aux.rs

index 48f71d95c429aa87591169559607e60a0923bafe..88e09c306006083dca903b179a1f711fdcbc3a1a 100644 (file)
@@ -49,8 +49,8 @@ fn check_for_overlapping_impls_of_trait(&self,
 
         // FIXME -- it seems like this method actually pushes
         // duplicate impls onto the list
-        ty::populate_implementations_for_type_if_necessary(self.tcx,
-                                                           trait_def_id);
+        ty::populate_implementations_for_trait_if_necessary(self.tcx,
+                                                            trait_def_id);
 
         let mut impls = Vec::new();
         self.push_impls_of_trait(trait_def_id, &mut impls);
index c1aa6ccd9bde6ff20ab6b687a91a7ed81b21af29..99446be43acaa7930caf30614581a0ce0d7f6328 100644 (file)
@@ -15,7 +15,9 @@
 extern crate trait_impl_conflict;
 use trait_impl_conflict::Foo;
 
-impl<A> Foo for A { //~ ERROR E0117
+impl<A> Foo for A {
+    //~^ ERROR E0117
+    //~^^ ERROR E0119
 }
 
 fn main() {