[rust-dev] Bounds on type variables in structs, enums, types

Nick Cameron lists at ncameron.org
Tue Mar 25 17:29:49 PDT 2014


I made an RFC - https://github.com/rust-lang/rfcs/pull/20


On Wed, Mar 26, 2014 at 9:25 AM, Nick Cameron <lists at ncameron.org> wrote:

> The removal was in https://github.com/mozilla/rust/pull/4660, but there
> is no discussion of why. Do you recall who promoted the change?
>
> I fear it makes the syntax simpler, but the language more complex and
> surprising.
>
>
> On Wed, Mar 26, 2014 at 6:00 AM, Patrick Walton <pcwalton at mozilla.com>wrote:
>
>> On 3/24/14 11:46 PM, Nick Cameron wrote:
>>
>>> Currently we forbid bounds on type parameters in structs, enums, and
>>> types. So the following is illegal:
>>>
>>> struct S<X: B> {
>>>      f: ~T<X>,
>>> }
>>>
>>
>> IIRC Haskell allows bounds on type parameters (and we did once too), but
>> I heard that considered deprecated and not preferred. I don't recall the
>> exact reasons, but that's why we removed the feature (and also just for
>> language simplicity).
>>
>> Patrick
>>
>> _______________________________________________
>> Rust-dev mailing list
>> Rust-dev at mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140326/54e6b571/attachment-0001.html>


More information about the Rust-dev mailing list