Looks like it's broken at the moment. If I try to compile this program:

trait Constructable<'self> { fn construct(v : &'self[u8]) -> Self; }
fn main() { }

I get this error:

error: internal compiler error: ty::Region#subst(): Reference to self
region when given substs with no self region: substs(self_r=None,
self_ty=Some(BUG[0]), tps=[])

On Wed, Jul 24, 2013 at 9:09 AM, Niko Matsakis <[email protected]> wrote:
> On Sun, Jul 21, 2013 at 12:44:24PM -0400, David Renshaw wrote:
>> Hello everyone,
>>
>> I'm playing around with a Rust implementation for Cap'n Proto. Check
>> it out: http://github.com/dwrensha/capnproto-rust . I welcome any
>> comments or contributions.
>>
>> The reason I'm sharing this project with you now is I'd like to ask
>> about a language feature missing from Rust that I feel may be
>> hindering my progress.
>>
>> To the point, I want to be able define a trait like this:
>>
>> trait Constructable<'self> {
>>    fn construct<'a>(StructReader<'a>) -> Self<'a>;
>> }
>
> I believe it would it be possible to define the trait like so:
>
>     trait Constructable<'self> {
>         fn construct(StructReader<'self>) -> Self;
>     }
>
>
>
> regards,
>
> Niko
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to