mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-17 14:23:25 +03:00
Convert some comm tests to istrs. Issue #855
These spawn thunks need to take move-mode strings to be correct
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
use std;
|
||||
import std::task;
|
||||
|
||||
fn child2(s: str) { }
|
||||
fn child2(s: -istr) { }
|
||||
|
||||
fn main() { let x = task::spawn(bind child2("hi")); }
|
||||
fn main() { let x = task::spawn(bind child2(~"hi")); }
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
import std::task::yield;
|
||||
import std::task;
|
||||
|
||||
fn x(s: str, n: int) { log s; log n; }
|
||||
fn x(s: -istr, n: int) { log s; log n; }
|
||||
|
||||
fn main() {
|
||||
task::spawn(bind x("hello from first spawned fn", 65));
|
||||
task::spawn(bind x("hello from second spawned fn", 66));
|
||||
task::spawn(bind x("hello from third spawned fn", 67));
|
||||
task::spawn(bind x(~"hello from first spawned fn", 65));
|
||||
task::spawn(bind x(~"hello from second spawned fn", 66));
|
||||
task::spawn(bind x(~"hello from third spawned fn", 67));
|
||||
let i: int = 30;
|
||||
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std;
|
||||
import std::task;
|
||||
fn main() { task::spawn(bind child("Hello")); }
|
||||
fn main() { task::spawn(bind child(~"Hello")); }
|
||||
|
||||
fn child(s: str) {
|
||||
fn child(s: -str) {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user