From cab84be812be24f003c3db9b75637724798755f3 Mon Sep 17 00:00:00 2001 From: Brian Koropoff Date: Sun, 28 Sep 2014 14:17:22 -0700 Subject: [PATCH] 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 --- src/librustc/middle/typeck/coherence/overlap.rs | 4 ++-- src/test/compile-fail/conflicting-implementations-aux.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) 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() { -- 2.44.0