rust/src/libstd
bors 6beb376b5c auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis
This alters the borrow checker's requirements on invoking closures from
requiring an immutable borrow to requiring a unique immutable borrow. This means 
that it is illegal to invoke a closure through a `&` pointer because there is no 
guarantee that is not aliased. This does not mean that a closure is required to
be in a mutable location, but rather a location which can be proven to be
unique (often through a mutable pointer).
                                                                                 
For example, the following code is unsound and is no longer allowed:             
                                                                                 
    type Fn<'a> = ||:'a;                                                         
                                                                                 
    fn call(f: |Fn|) {                                                           
        f(|| {                                                                   
            f(|| {})                                                             
        });                                                                      
    }                                                                            
                                                                                 
    fn main() {                                                                  
        call(|a| {                                                               
            a();                                                                 
        });                                                                      
    }                                                                            
                                                                                 
There is no replacement for this pattern. For all closures which are stored in
structures, it was previously allowed to invoke the closure through `&self` but
it now requires invocation through `&mut self`.

The standard library has a good number of violations of this new rule, but the
fixes will be separated into multiple breaking change commits.
                                                                                 
Closes #12224
2014-04-23 12:01:53 -07:00
..
comm Rewrite paragraph describing difference between try_send and send_opt 2014-04-19 10:23:15 -06:00
fmt Fix spelling mistakes in documentation and code. 2014-04-20 01:35:14 -04:00
hash Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
io auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
num auto merge of #13694 : jacob-hegna/rust/master, r=brson 2014-04-23 05:51:30 -07:00
path Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
rt auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
sync Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
unstable auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
any.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
ascii.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
bool.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
c_str.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
c_vec.rs Register new snapshots 2014-04-08 00:03:11 -07:00
cast.rs auto merge of #13651 : ryantm/rust/master, r=brson 2014-04-22 10:46:32 -07:00
cell.rs Stop using transmute_mut in RefCell 2014-04-10 15:21:59 -07:00
char.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
cleanup.rs Convert most code to new inner attribute syntax. 2014-03-28 17:12:21 -07:00
clone.rs Made the clone_from implementation for ~T reuse the T itself if 2014-03-18 16:29:57 -07:00
cmp.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
container.rs Add a default impl for Set::is_superset 2014-04-15 19:45:00 -07:00
default.rs libstd: Remove all support code related to @mut 2014-01-03 14:02:00 -08:00
from_str.rs std: uniform modules titles for doc 2013-12-27 09:49:11 +01:00
gc.rs std: Switch field privacy as necessary 2014-03-31 15:17:12 -07:00
intrinsics.rs auto merge of #13693 : thestinger/rust/mem, r=alexcrichton 2014-04-23 04:36:32 -07:00
iter.rs Fix other bugs with new closure borrowing 2014-04-23 10:03:43 -07:00
kinds.rs std: Switch field privacy as necessary 2014-03-31 15:17:12 -07:00
lib.rs add support for quadruple precision floating point 2014-04-22 20:47:28 -04:00
local_data.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
macros.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
managed.rs std: remove the equals method from TotalEq. 2014-03-23 23:48:10 +11:00
mem.rs auto merge of #13643 : aochagavia/rust/pr-2, r=alexcrichton 2014-04-20 10:21:32 -07:00
ops.rs libtest: rename BenchHarness to Bencher 2014-04-11 17:31:13 +08:00
option.rs Fix other bugs with new closure borrowing 2014-04-23 10:03:43 -07:00
os.rs auto merge of #13613 : alexcrichton/rust/fix-freebsd-compile, r=brson 2014-04-19 15:31:28 -07:00
owned.rs std: remove the equals method from TotalEq. 2014-03-23 23:48:10 +11:00
prelude.rs Merge the Round trait into the Float trait 2014-04-19 10:41:45 +10:00
ptr.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
raw.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
rc.rs std: Switch field privacy as necessary 2014-03-31 15:17:12 -07:00
reference.rs std: remove the equals method from TotalEq. 2014-03-23 23:48:10 +11:00
reflect.rs add support for quadruple precision floating point 2014-04-22 20:47:28 -04:00
repr.rs add support for quadruple precision floating point 2014-04-22 20:47:28 -04:00
result.rs Fix other bugs with new closure borrowing 2014-04-23 10:03:43 -07:00
rtdeps.rs Remove libc from std 2014-04-04 09:31:21 -07:00
slice.rs auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
str.rs auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
strbuf.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00
task.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
to_str.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
tuple.rs Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
ty.rs Fix an unnecessary use of cast::transmute 2014-04-05 20:38:35 +02:00
unicode.rs Convert most code to new inner attribute syntax. 2014-03-28 17:12:21 -07:00
unit.rs std: remove the equals method from TotalEq. 2014-03-23 23:48:10 +11:00
vec.rs Fix misspellings in comments. 2014-04-21 00:49:39 -04:00