Conversation
|
👍 Overall I think this is good. What happens if |
|
Yeah, we'd probably want the compiler to forbid "overlapping" definitions. |
There was a problem hiding this comment.
Why does IndexMut<E, R> require Index<E, R>?
There was a problem hiding this comment.
For the upgrade mechanism required to fix the DerefMut-in-immutable-contexts issue.
Or is it downgrade? In any case, one of IndexMut or Index is picked, and depending on whether the result is required to be a mutable lvalue (e.g. method call with &mut self) or not, the operation will be adjusted to use the more appropriate trait.
|
Why can't My use case is a matrix type defined like so: struct Matrix<T>
{
elems: Vec<Cell<T>>
} |
|
I don't think we need |
|
I'm assuming the lifetime parameter in This option is mentioned briefly in the RFC. @alexcrichton had some concerns about it with respect to how the compiler would decide what I am still a bit concerned with the weirdness of the by-value overload setup, but it's not the end of the world, and it seems to add a lot more flexibility. |
|
@sfackler: Ah, I apparently didn't understand that you meant in that section. I think if we go down my route, are there any situations where a data structure would want to have overlapping implementations of Also, the lifetime was needed, but with perhaps it's unnecessary now that we have lifetime elision? |
6357402 to
e0acdf4
Compare
|
This is an important topic, but by now it's clear we won't be getting to this at the moment. I hope we can come back to it shortly after 1.0 though. Postponing along with |
No description provided.