Skip to content

Commit cab84be

Browse files
committed
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 rust-lang#17593
1 parent 34dfa45 commit cab84be

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/librustc/middle/typeck/coherence/overlap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {
4949

5050
// FIXME -- it seems like this method actually pushes
5151
// duplicate impls onto the list
52-
ty::populate_implementations_for_type_if_necessary(self.tcx,
53-
trait_def_id);
52+
ty::populate_implementations_for_trait_if_necessary(self.tcx,
53+
trait_def_id);
5454

5555
let mut impls = Vec::new();
5656
self.push_impls_of_trait(trait_def_id, &mut impls);

src/test/compile-fail/conflicting-implementations-aux.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
extern crate trait_impl_conflict;
1616
use trait_impl_conflict::Foo;
1717

18-
impl<A> Foo for A { //~ ERROR E0117
18+
impl<A> Foo for A {
19+
//~^ ERROR E0117
20+
//~^^ ERROR E0119
1921
}
2022

2123
fn main() {

0 commit comments

Comments
 (0)