]> git.lizzy.rs Git - rust.git/commitdiff
Forbid duplicate supertraits
authorTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 16 Nov 2012 23:12:14 +0000 (15:12 -0800)
committerTim Chevalier <chevalier@alum.wellesley.edu>
Fri, 16 Nov 2012 23:12:14 +0000 (15:12 -0800)
I actually already pushed most of this by accident before I meant to, but
r=nmatsakis anyway.

Closes #3953

src/librustc/middle/typeck/collect.rs

index 7fc0b65d10cae736cc4ea1b1be33ab345b42c2d0..0c6fe58576810d660af07c7a9344be8ac1abfd99 100644 (file)
@@ -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 \