From: Brian Koropoff Date: Sun, 28 Sep 2014 21:17:22 +0000 (-0700) Subject: Correctly populate trait impl map when checking for impl overlaps X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=cab84be812be24f003c3db9b75637724798755f3;p=rust.git Correctly populate trait impl map when checking for impl overlaps Also fix an existing compile-fail test which was intended to cover this case. This closes issue #17593 --- diff --git a/src/librustc/middle/typeck/coherence/overlap.rs b/src/librustc/middle/typeck/coherence/overlap.rs index 48f71d95c42..88e09c30600 100644 --- a/src/librustc/middle/typeck/coherence/overlap.rs +++ b/src/librustc/middle/typeck/coherence/overlap.rs @@ -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); diff --git a/src/test/compile-fail/conflicting-implementations-aux.rs b/src/test/compile-fail/conflicting-implementations-aux.rs index c1aa6ccd9bd..99446be43ac 100644 --- a/src/test/compile-fail/conflicting-implementations-aux.rs +++ b/src/test/compile-fail/conflicting-implementations-aux.rs @@ -15,7 +15,9 @@ extern crate trait_impl_conflict; use trait_impl_conflict::Foo; -impl Foo for A { //~ ERROR E0117 +impl Foo for A { + //~^ ERROR E0117 + //~^^ ERROR E0119 } fn main() {