-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
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)
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.