Add array! macro for non-copy types
Fixes: #32
This is unsound. Consider what happens if break is used as an expression. Also, this should be using $crate:: to avoid risk of referring to wrong std.
Consider what happens if
breakis used as an expression.
There is no break, is there?
The only issue would be a potential panic! in the body of the loop and the already initialized elements not getting dropped, leading to a memory leak
Consider what happens if
breakis used as an expression.There is no
break, is there?The only issue would be a potential
panic!in the body of the loop and the already initialized elements not getting dropped, leading to a memory leak
Well, the user could provide break as an expression, and that would escape the loop early.
Oh I see what you mean now.
Maybe moving the expression to a variable outside the loop and cloning it for every element would be better in that regard?