Yesterday in IRC we noted a slight problem. The
= operator can mean one of three things when used in relation to types:
- “Default” types. Eg
struct Foo<T=u8>(T). This means that if unspecified,
- Equality for associated types. For example,
T: Iterator<Item=u8>can be used to specify that type
Tis an iterator over
- The mythical equality bound in
where. There is partial internal support for things like
where T == Fooor whatever (probably can be much more complex given the nature of
whereclauses). I don’t know what the plan is for these, but these will probably add more complexity to type bounds.
Having three usages for
= in type bounds is confusing. The compiler can tell them apart via context, but it can be confusing for a human to read.
Perhaps we should change the operators being used here somehow?