Uh oh!
There was an error while loading. Please reload this page.
Make vec::IntoIter covariant again - #35733
Conversation
This uses integer indices instead of pointers to avoid aliasing structIntoIter<T>{buf:Shared<T>,cap:usize,head:Shared<T>,tail:Shared<T>,} |
There was a problem hiding this comment.
This could also be: if self.is_empty(), I think?
alexcrichton
commented
Aug 16, 2016
In the past this has been pretty performance-sensitive, could you benchmark just a forward iteration of a Also nominating for backport as beta was cut today and we don't want to miss this. |
apasel422
commented
Aug 16, 2016
@alexcrichton Ah, if someone else could help out with benchmarks, that'd be great. If they indicate that this approach is slower, I'd be happy to rewrite this to use the other approach I mentioned. |
@apasel422 could you gist the IR for this: extern{fnbar(a:u8);}pubfnsum(v:Vec<u8>){for e in v.into_iter(){unsafe{bar(e);}}}For me, |
apasel422
commented
Aug 17, 2016
alexcrichton
commented
Aug 17, 2016
Hm so that's different because LLVM still has an add instruction, I'm not sure how much that'll end up translating to missed optimizations though. Maybe it's worth to stick to a two-pointers-approaching-each-other implementation though? |
apasel422
commented
Aug 17, 2016
@alexcrichton Done. |
alexcrichton
commented
Aug 17, 2016
bors
commented
Aug 17, 2016
Make `vec::IntoIter` covariant again Closes#35721 r? @alexcrichton
bors
commented
Aug 17, 2016
retep998
commented
Aug 18, 2016
Might be worth backporting this to beta, as the regression lived just long enough to jump into beta. |
apasel422
commented
Aug 19, 2016
@alexcrichton Can we get this backported to beta? |
alexcrichton
commented
Aug 19, 2016
Yes this is tagged with beta-nominated, and we'll discuss at the next libs triage meeting. It'll likely be an obvious "yes let's backport" |
The regression in rust-lang/rust#35721 will most likely not be backported to beta until next week - see rust-lang/rust#35733 - so it probably makes sense to disable it for now.
alexcrichton
commented
Aug 23, 2016
Discussion at @rust-lang/libs today decided to accept for backport |
Closes#35721
r? @alexcrichton