Well maybe if presence of a reference affected what [i] desugars to? Though I think that would break foos[i].bar() where bar: fn(&Foo) You'd have to always call methods on an index expression as (&[mut] foos[i]).bar(). And at that point then it'd be a better idea to throw Index out altogether.
The distinction I should have made explicit would be that a type (only ones that currently don't support indexing of course) could support value-only indexing, and the syntax would lower based on which was relevant (the blanket impl is mostly a suggestion of the semantics, not the actual mechanism), but picking a lowering based on implemented traits is probably the "not that simple" bit.
This topic was automatically closed 540 days after the last reply. New replies are no longer allowed.