rust/src/test
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
..
auxiliary Allow inheritance between structs. 2014-04-20 13:41:18 +12:00
bench auto merge of #13667 : TeXitoi/rust/shootout-chameneos-redux-fix, r=alexcrichton 2014-04-22 12:01:34 -07:00
codegen Add pub to all the codegen tests 2013-10-10 06:00:51 -07:00
compile-fail auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
debug-info Allow inheritance between structs. 2014-04-20 13:41:18 +12:00
pretty Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
run-fail Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
run-make Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00
run-pass auto merge of #13686 : alexcrichton/rust/issue-12224, r=nikomatsakis 2014-04-23 12:01:53 -07:00
run-pass-fulldeps Replace all ~"" with "".to_owned() 2014-04-18 17:25:34 -07:00