From 6d8d258f35321ed257d76d5e3c6458eed00ba574 Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Fri, 31 Aug 2012 19:01:24 -0400 Subject: [PATCH] Tag things that have to do with default methods with issue #2794. --- src/rustc/middle/trans/base.rs | 2 +- src/rustc/middle/typeck/infer/combine.rs | 2 ++ src/rustc/middle/typeck/infer/glb.rs | 2 +- src/rustc/middle/typeck/infer/lub.rs | 2 +- src/rustc/middle/typeck/infer/sub.rs | 2 +- src/test/run-pass/traits-default-method-self.rs | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index 0c00752289e..cb49daa4814 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -2567,7 +2567,7 @@ fn lookup_discriminant(ccx: @crate_ctxt, vid: ast::def_id) -> ValueRef { } // This shouldn't exist. We should cast self *once*, but right now this -// conflicts with default methods. +// conflicts with default methods. (FIXME: #2794) fn cast_self(cx: block, slf: val_self_data) -> ValueRef { PointerCast(cx, slf.v, T_ptr(type_of(cx.ccx(), slf.t))) } diff --git a/src/rustc/middle/typeck/infer/combine.rs b/src/rustc/middle/typeck/infer/combine.rs index 6f8fa5647a9..21e95c21beb 100644 --- a/src/rustc/middle/typeck/infer/combine.rs +++ b/src/rustc/middle/typeck/infer/combine.rs @@ -14,6 +14,8 @@ // call the `super_X(foo, ...)` functions directly, but rather call // `foo.X(...)`. The implementation of `X()` can then choose to delegate // to the `super` routine or to do other things. +// (FIXME (#2794): revise this paragraph once default methods in traits +// are working.) // // In reality, the sub operation is rather different from lub/glb, but // they are combined into one trait to avoid duplication (they used to diff --git a/src/rustc/middle/typeck/infer/glb.rs b/src/rustc/middle/typeck/infer/glb.rs index 7243efb9db7..26a9cd0ebd6 100644 --- a/src/rustc/middle/typeck/infer/glb.rs +++ b/src/rustc/middle/typeck/infer/glb.rs @@ -128,7 +128,7 @@ impl Glb: combine { lattice_tys(&self, a, b) } - // Traits please: + // Traits please (FIXME: #2794): fn flds(a: ty::field, b: ty::field) -> cres { super_flds(&self, a, b) diff --git a/src/rustc/middle/typeck/infer/lub.rs b/src/rustc/middle/typeck/infer/lub.rs index c2477c695bf..d33b127d4d5 100644 --- a/src/rustc/middle/typeck/infer/lub.rs +++ b/src/rustc/middle/typeck/infer/lub.rs @@ -103,7 +103,7 @@ impl Lub: combine { } } - // Traits please: + // Traits please (FIXME: #2794): fn tys(a: ty::t, b: ty::t) -> cres { lattice_tys(&self, a, b) diff --git a/src/rustc/middle/typeck/infer/sub.rs b/src/rustc/middle/typeck/infer/sub.rs index 7a039ae497a..93d7d1a41ed 100644 --- a/src/rustc/middle/typeck/infer/sub.rs +++ b/src/rustc/middle/typeck/infer/sub.rs @@ -165,7 +165,7 @@ impl Sub: combine { super_fns(&self, &a_fn_ty, &b_fn_ty) } - // Traits please: + // Traits please (FIXME: #2794): fn flds(a: ty::field, b: ty::field) -> cres { super_flds(&self, a, b) diff --git a/src/test/run-pass/traits-default-method-self.rs b/src/test/run-pass/traits-default-method-self.rs index c1ecaa5fa15..059d1c0b416 100644 --- a/src/test/run-pass/traits-default-method-self.rs +++ b/src/test/run-pass/traits-default-method-self.rs @@ -1,6 +1,6 @@ //xfail-test -// Currently failing with an ICE in trans. +// Currently failing with an ICE in trans. (FIXME: #2794) trait Cat { fn meow() -> bool;