Fix fallout of removing default bounds

This is all purely fallout of getting the previous commit to compile.
This commit is contained in:
Alex Crichton 2014-03-08 18:21:49 -08:00
parent bdd24b2a56
commit bb9172d7b5
61 changed files with 378 additions and 364 deletions

View file

@ -29,7 +29,7 @@ impl Drop for Foo {
#[macro_registrar]
pub fn registrar(_: |Name, SyntaxExtension|) {
local_data_key!(foo: ~Any);
local_data::set(foo, ~Foo { foo: 10 } as ~Any);
local_data_key!(foo: ~Any:Send);
local_data::set(foo, ~Foo { foo: 10 } as ~Any:Send);
}

View file

@ -31,12 +31,12 @@ impl Foo for B
struct A
{
v: ~Foo,
v: ~Foo:Send,
}
fn main()
{
let a = A {v: ~B{v: None} as ~Foo};
let a = A {v: ~B{v: None} as ~Foo:Send};
//~^ ERROR cannot pack type `~B`, which does not fulfill `Send`
let v = Rc::new(RefCell::new(a));
let w = v.clone();

View file

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

View file

@ -12,7 +12,7 @@
trait Foo {}
fn a(_x: ~Foo) { // should be same as ~Foo:Send
fn a(_x: ~Foo:Send) {
}
fn b(_x: &'static Foo) { // should be same as &'static Foo:'static

View file

@ -11,5 +11,5 @@
// error-pattern:failed at '~Any'
fn main() {
fail!(~413 as ~::std::any::Any);
fail!(~413 as ~::std::any::Any:Send);
}

View file

@ -18,7 +18,7 @@ fn failfn() {
fn main() {
let y = ~0;
let x: @proc() = @(proc() {
let x: @proc:Send() = @(proc() {
println!("{:?}", y.clone());
});
failfn();

View file

@ -42,7 +42,7 @@ fn main() {
let (tx, rx) = channel();
let (mut r, w) = (ChanReader::new(rx), ChanWriter::new(tx));
spawn(proc() {
set_logger(~MyWriter(w) as ~Logger);
set_logger(~MyWriter(w) as ~Logger:Send);
debug!("debug");
info!("info");
});

View file

@ -18,7 +18,7 @@ struct Pair {
pub fn main() {
let z = ~Pair { a : 10, b : 12};
let f: proc() = proc() {
let f: proc:Send() = proc() {
assert_eq!(z.a, 10);
assert_eq!(z.b, 12);
};

View file

@ -12,13 +12,13 @@ use std::task;
static generations: uint = 1024+256+128+49;
fn spawn(f: proc()) {
fn spawn(f: proc:Send()) {
let mut t = task::task();
t.opts.stack_size = Some(32 * 1024);
t.spawn(f);
}
fn child_no(x: uint) -> proc() {
fn child_no(x: uint) -> proc:Send() {
proc() {
if x < generations {
spawn(child_no(x+1));

View file

@ -11,7 +11,7 @@
use std::task;
type RingBuffer = Vec<f64> ;
type SamplesFn = proc(samples: &RingBuffer);
type SamplesFn = proc:Send(samples: &RingBuffer);
enum Msg
{

View file

@ -18,7 +18,7 @@ fn test05_start(f: proc(int)) {
fn test05() {
let three = ~3;
let fn_to_send: proc(int) = proc(n) {
let fn_to_send: proc:Send(int) = proc(n) {
println!("{}", *three + n); // will copy x into the closure
assert_eq!(*three, 3);
};

View file

@ -36,7 +36,7 @@ fn test_tempdir() {
fn test_rm_tempdir() {
let (tx, rx) = channel();
let f: proc() = proc() {
let f: proc:Send() = proc() {
let tmp = TempDir::new("test_rm_tempdir").unwrap();
tx.send(tmp.path().clone());
fail!("fail to unwind past `tmp`");
@ -47,7 +47,7 @@ fn test_rm_tempdir() {
let tmp = TempDir::new("test_rm_tempdir").unwrap();
let path = tmp.path().clone();
let f: proc() = proc() {
let f: proc:Send() = proc() {
let _tmp = tmp;
fail!("fail to unwind past `tmp`");
};
@ -56,7 +56,7 @@ fn test_rm_tempdir() {
let path;
{
let f: proc() -> TempDir = proc() {
let f = proc() {
TempDir::new("test_rm_tempdir").unwrap()
};
let tmp = task::try(f).ok().expect("test_rm_tmdir");

View file

@ -26,7 +26,7 @@ fn d(x: ~Foo:Send) {
}
fn e(x: ~Foo) { // sugar for ~Foo:Owned
b(x);
a(x);
}
pub fn main() { }

View file

@ -18,7 +18,7 @@ struct Tree(@RefCell<TreeR>);
struct TreeR {
left: Option<Tree>,
right: Option<Tree>,
val: ~to_str
val: ~to_str:Send
}
trait to_str {
@ -53,10 +53,10 @@ fn foo<T:to_str>(x: T) -> ~str { x.to_str_() }
pub fn main() {
let t1 = Tree(@RefCell::new(TreeR{left: None,
right: None,
val: ~1 as ~to_str}));
val: ~1 as ~to_str:Send}));
let t2 = Tree(@RefCell::new(TreeR{left: Some(t1),
right: Some(t1),
val: ~2 as ~to_str}));
val: ~2 as ~to_str:Send}));
let expected = ~"[2, some([1, none, none]), some([1, none, none])]";
assert!(t2.to_str_() == expected);
assert!(foo(t2) == expected);

View file

@ -19,12 +19,11 @@ enum maybe_pointy {
struct Pointy {
a : maybe_pointy,
d : proc() -> uint,
d : proc:Send() -> uint,
}
fn make_uniq_closure<A:Send>(a: A) -> proc() -> uint {
let result: proc() -> uint = proc() &a as *A as uint;
result
fn make_uniq_closure<A:Send>(a: A) -> proc:Send() -> uint {
proc() { &a as *A as uint }
}
fn empty_pointy() -> @RefCell<Pointy> {

View file

@ -20,7 +20,7 @@ enum maybe_pointy {
struct Pointy {
a : maybe_pointy,
c : ~int,
d : proc()->(),
d : proc:Send()->(),
}
fn empty_pointy() -> @RefCell<Pointy> {