Uh oh!
There was an error while loading. Please reload this page.
remove certain array elem moves for non-zeroing drop - #533
Conversation
reem
commented
Dec 20, 2014
My only worry here is that I'd like there to be a way to get a by-value Iterator over a small, constant number of items without allocating (right now it requires |
arielb1
commented
Dec 20, 2014
This version of array indexing isn't useful for iterators, as it prevents access to all elements of the array except the one accessed. The problem with array iterators is that we can't have impls generic over integers. |
thestinger
commented
Dec 20, 2014
@reem: It definitely doesn't prevent that. Look at how the by-value vector iterator is implemented. |
thestinger
commented
Dec 20, 2014
It's not going to work well though, because you need to take the fixed-size array by-value... which is not going to scale at all. |
reem
commented
Dec 20, 2014
I guess it is orthogonal to this RFC, but I imagined the implementation would take some form of |
pnkfelix
commented
Dec 22, 2014
@reem removing language features such as this now does not preclude making other independent additions in the future that would enable useful functionality. The only issue I could see would be if there is some useful pattern that is allowed today that would be made invalid by changes in this RFC, but as far as I can tell (and as mentioned in the comments above) the example you describe cannot be expressed today. |
pnkfelix
commented
Jan 16, 2015
@nikomatsakis can we get discussion of this at a meeting? |
pnkfelix
commented
Feb 2, 2015
@nikomatsakis please do bring this up with core team when you can. |
Add link to prototype implementation. Add note that destructuring bind is not affected by the change proposed here. Account for change in type syntax from `[E, ..k]` to `[E; k]`.
nikomatsakis
commented
Feb 5, 2015
We've decided to accept this RFC. The precautions here are sensible and unlikely to have wide-spread impact on Rust code. If necessary, they can be lifted later, at the cost of more complex codegen. |
nikomatsakis
commented
Feb 5, 2015
Tracking issue rust-lang/rust#21963. |
Summary
In order to prepare for an expected future implementation of
non-zeroing dynamic drop, remove support for:
[T, ..n],(copying and borrowing such elements is still permitted).
(rendered)