rust/src
Ariel Ben-Yehuda 7b25e88602 forbid moves out of slices
The wording of RFC #495 enables moves out of slices. Unfortuantely, non-zeroing
moves out of slices introduce a very annoying complication: as slices can
vary in their length, indexes from the start and end may or may not overlap
depending on the slice's exact length, which prevents assigning a particular
drop flag for each individual element.

For example, in the code

```Rust
fn foo<T>(a: Box<[Box<[T]>]>, c: bool) -> T {
    match (a, c) {
        (box [box [t, ..], ..], true) => t,
        (box [.., box [.., t]], false) => t,
        _ => panic!()
    }
}
```

If the condition is false, we have to drop the first element
of `a`, unless `a` has size 1 in which case we drop all the elements
of it but the last.

If someone comes with a nice way of handling it, we can always re-allow
moves out of slices.

This is a [breaking-change], but it is behind the `slice_patterns` feature
gate and was not allowed until recently.
2016-09-16 15:08:32 +03:00
..
bootstrap Auto merge of #36213 - josephDunne:dist_version, r=brson 2016-09-15 20:48:58 -07:00
build_helper
compiler-rt@8598065bd9
doc Rollup merge of #36374 - dangcheng:patch-1, r=steveklabnik 2016-09-14 17:15:37 +02:00
driver
etc
grammar
jemalloc@e058ca6616
liballoc Add pub fn ptr_eq(this: &Self, other: &Self) -> bool to Rc and Arc. 2016-09-15 18:48:16 +02:00
liballoc_jemalloc Add s390x support 2016-09-09 22:28:19 +01:00
liballoc_system Add s390x support 2016-09-09 22:28:19 +01:00
libarena
libbacktrace
libcollections Auto merge of #36347 - knight42:str-replacen, r=alexcrichton 2016-09-14 20:29:15 -07:00
libcollectionstest Add tests for str::replacen 2016-09-13 10:16:31 +08:00
libcompiler_builtins Link test to compiler builtins and make unstable 2016-09-13 12:27:26 -07:00
libcore Auto merge of #35992 - SimonSapin:rc-arc-ptr-eq, r=alexcrichton 2016-09-15 09:58:26 -07:00
libcoretest Documentation for default types modified 2016-09-11 22:58:01 +05:30
libflate
libfmt_macros
libgetopts
libgraphviz
liblibc@d4f6a19c55 Add s390x support 2016-09-09 22:28:19 +01:00
liblog
libpanic_abort
libpanic_unwind Add s390x support 2016-09-09 22:28:19 +01:00
libproc_macro
librand Documentation of what does for each type 2016-09-11 17:00:09 +05:30
librbml
librustc groundwork refactoring of gather_moves 2016-09-16 15:08:32 +03:00
librustc_back Auto merge of #36041 - ahmedcharles:try, r=nrc 2016-09-13 22:41:34 -07:00
librustc_bitflags
librustc_borrowck forbid moves out of slices 2016-09-16 15:08:32 +03:00
librustc_const_eval Auto merge of #36041 - ahmedcharles:try, r=nrc 2016-09-13 22:41:34 -07:00
librustc_const_math
librustc_data_structures Documentation of what does for each type 2016-09-11 17:00:09 +05:30
librustc_driver Expand generated test harnesses and macro registries. 2016-09-13 09:40:28 +00:00
librustc_errors Auto merge of #36338 - estebank:primitive-shadow, r=jseyfried 2016-09-16 00:39:27 -07:00
librustc_incremental Auto merge of #36041 - ahmedcharles:try, r=nrc 2016-09-13 22:41:34 -07:00
librustc_lint Delete stray ` character in error message. 2016-09-11 16:45:49 -06:00
librustc_llvm
librustc_macro
librustc_metadata Auto merge of #36393 - petrochenkov:ancient, r=eddyb 2016-09-15 13:34:11 -07:00
librustc_mir Use question_mark feature in librustc_mir. 2016-09-11 16:02:43 -07:00
librustc_passes
librustc_platform_intrinsics
librustc_plugin
librustc_privacy Auto merge of #36270 - petrochenkov:pipwarnagain, r=nikomatsakis 2016-09-14 12:04:30 -07:00
librustc_resolve Auto merge of #36393 - petrochenkov:ancient, r=eddyb 2016-09-15 13:34:11 -07:00
librustc_save_analysis Auto merge of #36331 - petrochenkov:tyadt, r=eddyb 2016-09-09 04:57:11 -07:00
librustc_trans groundwork refactoring of gather_moves 2016-09-16 15:08:32 +03:00
librustc_typeck Rollup merge of #36425 - michaelwoerister:stable-projection-bounds, r=eddyb 2016-09-15 18:16:20 +05:30
librustc_unicode
librustdoc Auto merge of #36393 - petrochenkov:ancient, r=eddyb 2016-09-15 13:34:11 -07:00
libserialize Use question_mark feature in libserialize. 2016-09-11 16:02:43 -07:00
libstd Rollup merge of #36463 - eugene-bulkin:duration-checked-ops, r=alexcrichton 2016-09-15 18:16:22 +05:30
libsyntax Auto merge of #36393 - petrochenkov:ancient, r=eddyb 2016-09-15 13:34:11 -07:00
libsyntax_ext Rollup merge of #36438 - jseyfried:node_ids_in_expansion, r=nrc 2016-09-15 18:16:21 +05:30
libsyntax_pos
libterm
libtest
libunwind Add s390x support 2016-09-09 22:28:19 +01:00
llvm@16b79d01fd
rt
rtstartup
rust-installer@755bc3db4f
rustc crate-ify compiler-rt into compiler-builtins 2016-09-12 21:22:15 -07:00
rustllvm
test forbid moves out of slices 2016-09-16 15:08:32 +03:00
tools Use question_mark feature in compiletest. 2016-09-11 16:00:50 -07:00
stage0.txt