Closed
Description
Consider the following simple trait example:
pub trait Indexable<T>: Index<uint, T> {
fn index2(&self, i: uint) -> &T {
// Doesn't work:
// self[i]
// Does work
self.index(&i)
}
}
As you can see by the comments, using the []
-operator on self
doesn't work directly. Instead, one has to call the index
function manually.
It seems like something is broken with operators and super-traits.
$ rustc --version
rustc 0.12.0-nightly (b5ba2f551 2014-10-06 20:27:14 +0000)