File tree 3 files changed +40
-4
lines changed
3 files changed +40
-4
lines changed Original file line number Diff line number Diff line change @@ -489,10 +489,9 @@ pub fn trans_unboxed_closure<'blk, 'tcx>(
489
489
closure_id,
490
490
& bcx. fcx . param_substs . substs ) . unwrap ( ) ;
491
491
492
- let unboxed_closures = bcx. tcx ( ) . unboxed_closures . borrow ( ) ;
493
- let function_type = ( * unboxed_closures) [ closure_id]
494
- . closure_type
495
- . clone ( ) ;
492
+ let function_type = ( * bcx. tcx ( ) . unboxed_closures . borrow ( ) ) [ closure_id]
493
+ . closure_type
494
+ . clone ( ) ;
496
495
let function_type = ty:: mk_closure ( bcx. tcx ( ) , function_type) ;
497
496
498
497
let freevars: Vec < ty:: Freevar > =
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ feature( unboxed_closures, overloaded_calls) ]
12
+ #![ crate_type = "rlib" ]
13
+
14
+ pub fn inner < F > ( f : F ) -> F {
15
+ ( move |: | f) ( )
16
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // Test that we don't panic on a RefCell borrow conflict in certain
12
+ // code paths involving unboxed closures.
13
+
14
+ #![ feature( unboxed_closures, overloaded_calls) ]
15
+
16
+ // aux-build:issue-18711.rs
17
+ extern crate "issue-18711" as issue;
18
+
19
+ fn main ( ) {
20
+ ( |: | issue:: inner ( ( ) ) ) ( ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments