Skip to content

Correctly populate trait impl map when checking for impl overlaps #17613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/librustc/middle/typeck/coherence/overlap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ impl<'cx, 'tcx> OverlapChecker<'cx, 'tcx> {

// 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);
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/conflicting-implementations-aux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down