libsyntax: Remove the old-style borrowed closure type syntax from the
language.
This commit is contained in:
parent
9e610573ba
commit
6801bc8f55
15 changed files with 32 additions and 23 deletions
|
|
@ -9,10 +9,10 @@
|
|||
// except according to those terms.
|
||||
|
||||
struct X {
|
||||
field: &'static fn:Send(),
|
||||
field: 'static ||:Send,
|
||||
}
|
||||
|
||||
fn foo(blk: &'static fn:()) -> X {
|
||||
fn foo(blk: 'static ||:) -> X {
|
||||
return X { field: blk }; //~ ERROR expected bounds `Send` but found no bounds
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ extern mod extra;
|
|||
use extra::arc;
|
||||
use std::util;
|
||||
|
||||
fn foo(blk: &once fn()) {
|
||||
fn foo(blk: once ||) {
|
||||
blk();
|
||||
blk(); //~ ERROR use of moved value
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#[feature(once_fns)];
|
||||
fn main() {
|
||||
let f: &once fn() = ||();
|
||||
let f: once || = ||();
|
||||
let g: || = f; //~ ERROR mismatched types
|
||||
let h: || = ||();
|
||||
let i: &once fn() = h; // ok
|
||||
let i: once || = h; // ok
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ extern mod extra;
|
|||
use extra::arc;
|
||||
use std::util;
|
||||
|
||||
fn foo(blk: &once fn()) {
|
||||
fn foo(blk: once ||) {
|
||||
blk();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue