File tree 2 files changed +31
-2
lines changed
librustc/middle/typeck/check
2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -2248,8 +2248,19 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
2248
2248
}
2249
2249
_ => {
2250
2250
// Not an error! Means we're inferring the closure type
2251
- ( None , ast:: impure_fn, ast:: BorrowedSigil ,
2252
- ast:: Many , ty:: EmptyBuiltinBounds ( ) )
2251
+ let mut sigil = ast:: BorrowedSigil ;
2252
+ let mut onceness = ast:: Many ;
2253
+ let mut bounds = ty:: EmptyBuiltinBounds ( ) ;
2254
+ match expr. node {
2255
+ ast:: ExprProc ( ..) => {
2256
+ sigil = ast:: OwnedSigil ;
2257
+ onceness = ast:: Once ;
2258
+ bounds. add ( ty:: BoundSend ) ;
2259
+ }
2260
+ _ => ( )
2261
+ }
2262
+ ( None , ast:: impure_fn, sigil,
2263
+ onceness, bounds)
2253
2264
}
2254
2265
}
2255
2266
} ;
Original file line number Diff line number Diff line change
1
+ // Copyright 2013 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
+ fn f ( p : proc ( ) ) {
12
+ p ( ) ;
13
+ }
14
+
15
+ pub fn main ( ) {
16
+ let p = proc ( ) ( ) ;
17
+ f ( p) ;
18
+ }
You can’t perform that action at this time.
0 commit comments