Forbid duplicate supertraits
I actually already pushed most of this by accident before I meant to, but r=nmatsakis anyway. Closes #3953
This commit is contained in:
parent
5005be67cc
commit
428c58b9f9
@ -264,7 +264,7 @@ fn ensure_supertraits(ccx: @crate_ctxt,
|
||||
for trait_refs.each |trait_ref| {
|
||||
let (did, tpt) = instantiate_trait_ref(ccx, *trait_ref, rp);
|
||||
if instantiated.any(|other_trait: &InstantiatedTraitRef|
|
||||
{ (*other_trait).def_id == did }) {
|
||||
{ other_trait.def_id == did }) {
|
||||
// This means a trait inherited from the same supertrait more
|
||||
// than once.
|
||||
tcx.sess.span_err(sp, ~"Duplicate supertrait in trait \
|
||||
|
Loading…
Reference in New Issue
Block a user