rust/src/libcollections
Ulrik Sverdrup 765700ba7a Work around pointer aliasing issue in Vec::extend_from_slice, extend_with_element
Due to missing noalias annotations for &mut T in general (issue #31681),
in larger programs extend_from_slice and extend_with_element may both
compile very poorly. What is observed is that the .set_len() calls are
not lifted out of the loop, even for `Vec<u8>`.

Use a local length variable for the Vec length instead, and use a scope
guard to write this value back to self.len when the scope ends or on
panic. Then the alias analysis is easy.

This affects extend_from_slice, extend_with_element, the vec![x; n]
macro, Write impls for Vec<u8>, BufWriter, etc (but may / may not
have triggered since inlining can be enough for the compiler to get it right).
2016-09-09 02:38:47 +02:00
..
btree Add missing urls 2016-09-03 16:15:22 +02:00
binary_heap.rs Remove BinaryHeap bounds checking 2016-08-29 23:12:08 +02:00
borrow.rs Remove needless imports in libcollections. 2016-08-24 22:13:13 +00:00
Cargo.toml
enum_set.rs Add a FusedIterator trait. 2016-08-18 12:16:29 -04:00
fmt.rs Rust has type aliases, not typedefs. 2016-08-23 10:49:11 -04:00
lib.rs Remove drop flags from structs and enums implementing Drop. 2016-08-24 13:23:37 +03:00
linked_list.rs Remove needless imports in libcollections. 2016-08-24 22:13:13 +00:00
macros.rs
range.rs Remove needless imports in libcollections. 2016-08-24 22:13:13 +00:00
slice.rs Auto merge of #34762 - creativcoder:slice-ext, r=alexcrichton 2016-08-08 21:51:01 -07:00
str.rs Add a FusedIterator trait. 2016-08-18 12:16:29 -04:00
string.rs Auto merge of #35656 - Stebalien:fused, r=alexcrichton 2016-08-23 07:46:52 -07:00
vec_deque.rs Remove needless imports in libcollections. 2016-08-24 22:13:13 +00:00
vec.rs Work around pointer aliasing issue in Vec::extend_from_slice, extend_with_element 2016-09-09 02:38:47 +02:00