librustc: Convert ~fn() to proc() everywhere.

This commit is contained in:
Patrick Walton 2013-11-18 17:40:54 -08:00
parent 77f621bff4
commit ba739b2135
43 changed files with 57 additions and 145 deletions

View file

@ -11,7 +11,7 @@
// xfail-test #2978
struct Foo {
f: ~fn()
f: proc()
}
fn call(x: @Foo) {

View file

@ -1,13 +1,8 @@
pub fn main() {
let foo = ~3;
let _pfoo = &foo;
let _f: ~fn() -> int = || *foo + 5;
//~^ ERROR cannot move `foo`
// FIXME(#2202) - Due to the way that borrowck treats closures,
// you get two error reports here.
let bar = ~3;
let _g = || { //~ ERROR capture of moved value
let _h: ~fn() -> int = || *bar; //~ ERROR capture of moved value
let _h: proc() -> int = || *bar; //~ ERROR capture of moved value
};
}

View file

@ -1,4 +1,4 @@
fn call_f(f: ~fn:Send() -> int) -> int {
fn call_f(f: proc() -> int) -> int {
f()
}

View file

@ -9,10 +9,10 @@
// except according to those terms.
struct X {
field: ~fn:Send(),
field: &'static fn:Send(),
}
fn foo(blk: ~fn:()) -> X {
fn foo(blk: &'static fn:()) -> X {
return X { field: blk }; //~ ERROR expected bounds `Send` but found no bounds
}

View file

@ -14,7 +14,7 @@ fn foo(_x: @uint) {}
fn main() {
let x = @3u;
let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
let _: ~fn() = || foo(x); //~ ERROR does not fulfill `Send`
let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
let _: proc() = || foo(x); //~ ERROR does not fulfill `Send`
}

View file

@ -47,7 +47,7 @@ fn test<'a,T,U:Send>(_: &'a int) {
// but closure and object types can have lifetime bounds which make
// them not ok (FIXME #5121)
// assert_send::<~fn:'a()>(); // ERROR does not fulfill `Send`
// assert_send::<proc:'a()>(); // ERROR does not fulfill `Send`
// assert_send::<~Dummy:'a>(); // ERROR does not fulfill `Send`
// unsafe ptrs are ok unless they point at unsendable things

View file

@ -1,4 +1,4 @@
type Noncopyable = ~fn();
type Noncopyable = proc();
struct Foo {
copied: int,

View file

@ -1,29 +0,0 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Testing guarantees provided by once functions.
// This program would segfault if it were legal.
extern mod extra;
use extra::arc;
use std::util;
fn foo(blk: ~fn()) {
blk();
blk();
}
fn main() {
let x = arc::Arc::new(true);
do foo {
assert!(*x.get());
util::ignore(x); //~ ERROR cannot move out of captured outer variable
}
}

View file

@ -11,7 +11,7 @@
// check that the &int here does not cause us to think that `foo`
// contains region pointers
struct foo(~fn(x: &int));
struct foo(proc(x: &int));
fn take_foo(x: foo<'static>) {} //~ ERROR wrong number of lifetime parameters