test: Fix check-fast for resolve changes. rs=bustage

This commit is contained in:
Patrick Walton 2013-01-07 18:54:28 -08:00
parent 16ec9aa6e7
commit fcc470c0ee
45 changed files with 197 additions and 187 deletions

View File

@ -14,7 +14,7 @@
enum t { make_t(@int), clam, }
fn foo(s: @int) {
let count = core::sys::refcount(s);
let count = ::core::sys::refcount(s);
let x: t = make_t(s); // ref up
match x {
@ -24,20 +24,20 @@ fn foo(s: @int) {
}
_ => { debug!("?"); fail; }
}
log(debug, core::sys::refcount(s));
assert (core::sys::refcount(s) == count + 1u);
let _ = core::sys::refcount(s); // don't get bitten by last-use.
log(debug, ::core::sys::refcount(s));
assert (::core::sys::refcount(s) == count + 1u);
let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
}
fn main() {
let s: @int = @0; // ref up
let count = core::sys::refcount(s);
let count = ::core::sys::refcount(s);
foo(s); // ref up then down
log(debug, core::sys::refcount(s));
let count2 = core::sys::refcount(s);
let _ = core::sys::refcount(s); // don't get bitten by last-use.
log(debug, ::core::sys::refcount(s));
let count2 = ::core::sys::refcount(s);
let _ = ::core::sys::refcount(s); // don't get bitten by last-use.
assert count == count2;
}

View File

@ -10,25 +10,25 @@
// except according to those terms.
fn a(c: core::oldcomm::Chan<int>) { core::oldcomm::send(c, 10); }
fn a(c: ::core::oldcomm::Chan<int>) { ::core::oldcomm::send(c, 10); }
fn main() {
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
task::spawn(|| a(ch) );
task::spawn(|| a(ch) );
let mut n: int = 0;
n = core::oldcomm::recv(p);
n = core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
// debug!("Finished.");
}
fn b(c: core::oldcomm::Chan<int>) {
fn b(c: ::core::oldcomm::Chan<int>) {
// debug!("task b0");
// debug!("task b1");
// debug!("task b2");
// debug!("task b3");
// debug!("task b4");
// debug!("task b5");
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
}

View File

@ -10,28 +10,28 @@
// except according to those terms.
fn a(c: core::oldcomm::Chan<int>) {
fn a(c: ::core::oldcomm::Chan<int>) {
debug!("task a0");
debug!("task a1");
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
}
fn main() {
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
task::spawn(|| a(ch) );
task::spawn(|| b(ch) );
let mut n: int = 0;
n = core::oldcomm::recv(p);
n = core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
debug!("Finished.");
}
fn b(c: core::oldcomm::Chan<int>) {
fn b(c: ::core::oldcomm::Chan<int>) {
debug!("task b0");
debug!("task b1");
debug!("task b2");
debug!("task b2");
debug!("task b3");
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
}

View File

@ -10,7 +10,7 @@
// except according to those terms.
fn a(c: core::oldcomm::Chan<int>) {
fn a(c: ::core::oldcomm::Chan<int>) {
if true {
debug!("task a");
debug!("task a");
@ -18,7 +18,7 @@ fn a(c: core::oldcomm::Chan<int>) {
debug!("task a");
debug!("task a");
}
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
}
fn k(x: int) -> int { return 15; }
@ -34,18 +34,18 @@ fn main() {
let mut n: int = 2 + 3 * 7;
let s: ~str = ~"hello there";
let p = oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let ch = ::core::oldcomm::Chan(&p);
task::spawn(|| a(ch) );
task::spawn(|| b(ch) );
let mut x: int = 10;
x = g(n, s);
log(debug, x);
n = core::oldcomm::recv(p);
n = core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
n = ::core::oldcomm::recv(p);
debug!("children finished, root finishing");
}
fn b(c: core::oldcomm::Chan<int>) {
fn b(c: ::core::oldcomm::Chan<int>) {
if true {
debug!("task b");
debug!("task b");
@ -54,5 +54,5 @@ fn b(c: core::oldcomm::Chan<int>) {
debug!("task b");
debug!("task b");
}
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
}

View File

@ -63,9 +63,9 @@ fn test_box() {
}
fn test_ptr() unsafe {
let p1: *u8 = core::cast::reinterpret_cast(&0);
let p2: *u8 = core::cast::reinterpret_cast(&0);
let p3: *u8 = core::cast::reinterpret_cast(&1);
let p1: *u8 = ::core::cast::reinterpret_cast(&0);
let p2: *u8 = ::core::cast::reinterpret_cast(&0);
let p3: *u8 = ::core::cast::reinterpret_cast(&1);
assert p1 == p2;
assert p1 != p3;
@ -110,8 +110,8 @@ fn test_class() {
unsafe {
error!("q = %x, r = %x",
(core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&q))),
(core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&r))));
(::core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&q))),
(::core::cast::reinterpret_cast::<*p, uint>(&ptr::addr_of(&r))));
}
assert(q == r);
r.y = 17;

View File

@ -24,9 +24,9 @@
// course preferable, as the value itself is
// irrelevant).
fn foo(&&x: ()) -> core::oldcomm::Port<()> {
let p = core::oldcomm::Port();
let c = core::oldcomm::Chan(&p);
fn foo(&&x: ()) -> ::core::oldcomm::Port<()> {
let p = ::core::oldcomm::Port();
let c = ::core::oldcomm::Chan(&p);
do task::spawn() |copy c, copy x| {
c.send(x);
}

View File

@ -18,7 +18,7 @@
extern mod cci_capture_clause;
use core::oldcomm::recv;
use ::core::oldcomm::recv;
fn main() {
cci_capture_clause::foo(()).recv()

View File

@ -10,32 +10,32 @@
// Issue #763
enum request { quit, close(core::oldcomm::Chan<bool>), }
enum request { quit, close(::core::oldcomm::Chan<bool>), }
type ctx = core::oldcomm::Chan<request>;
type ctx = ::core::oldcomm::Chan<request>;
fn request_task(c: core::oldcomm::Chan<ctx>) {
let p = core::oldcomm::Port();
core::oldcomm::send(c, core::oldcomm::Chan(&p));
fn request_task(c: ::core::oldcomm::Chan<ctx>) {
let p = ::core::oldcomm::Port();
::core::oldcomm::send(c, ::core::oldcomm::Chan(&p));
let mut req: request;
req = core::oldcomm::recv(p);
req = ::core::oldcomm::recv(p);
// Need to drop req before receiving it again
req = core::oldcomm::recv(p);
req = ::core::oldcomm::recv(p);
}
fn new_cx() -> ctx {
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
let t = task::spawn(|| request_task(ch) );
let mut cx: ctx;
cx = core::oldcomm::recv(p);
cx = ::core::oldcomm::recv(p);
return cx;
}
fn main() {
let cx = new_cx();
let p = core::oldcomm::Port::<bool>();
core::oldcomm::send(cx, close(core::oldcomm::Chan(&p)));
core::oldcomm::send(cx, quit);
let p = ::core::oldcomm::Port::<bool>();
::core::oldcomm::send(cx, close(::core::oldcomm::Chan(&p)));
::core::oldcomm::send(cx, quit);
}

View File

@ -11,7 +11,7 @@
// xfail-fast
// aux-build:cci_class_cast.rs
extern mod cci_class_cast;
use core::to_str::ToStr;
use ::core::to_str::ToStr;
use cci_class_cast::kitty::*;
fn print_out<T: ToStr>(thing: T, expected: ~str) {

View File

@ -9,7 +9,7 @@
// except according to those terms.
// xfail-fast
use core::to_str::*;
use ::core::to_str::*;
struct cat {
priv mut meows : uint,

View File

@ -10,7 +10,7 @@
fn main() {
enum x { foo }
impl x : core::cmp::Eq {
impl x : ::core::cmp::Eq {
pure fn eq(&self, other: &x) -> bool {
(*self) as int == (*other) as int
}

View File

@ -12,16 +12,16 @@
fn main() {
let p = oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let ch = ::core::oldcomm::Chan(&p);
let t = task::spawn(|| child(ch) );
let y = core::oldcomm::recv(p);
let y = ::core::oldcomm::recv(p);
error!("received");
log(error, y);
assert (y == 10);
}
fn child(c: core::oldcomm::Chan<int>) {
fn child(c: ::core::oldcomm::Chan<int>) {
error!("sending");
core::oldcomm::send(c, 10);
::core::oldcomm::send(c, 10);
error!("value sent");
}

View File

@ -14,5 +14,5 @@ fn main() {
let digits: uint = 10 as uint;
core::io::println(float::to_str(f64::sqrt(42.0f64) as float, digits));
::core::io::println(float::to_str(f64::sqrt(42.0f64) as float, digits));
}

View File

@ -11,12 +11,12 @@
fn main() {
let po = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&po);
core::oldcomm::send(ch, 10);
let i = core::oldcomm::recv(po);
let po = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&po);
::core::oldcomm::send(ch, 10);
let i = ::core::oldcomm::recv(po);
assert (i == 10);
core::oldcomm::send(ch, 11);
let j = core::oldcomm::recv(po);
::core::oldcomm::send(ch, 11);
let j = ::core::oldcomm::recv(po);
assert (j == 11);
}

View File

@ -1,3 +1,5 @@
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -1,3 +1,5 @@
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -1,3 +1,5 @@
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -12,7 +12,7 @@ struct S<T> {
x: T
}
impl<T> S<T> : core::ops::Drop {
impl<T> S<T> : ::core::ops::Drop {
fn finalize(&self) {
io::println("bye");
}

View File

@ -1,3 +1,5 @@
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -23,7 +23,7 @@ extern mod zed {
extern mod libc {
#[legacy_exports];
fn write(fd: int, buf: *u8,
count: core::libc::size_t) -> core::libc::ssize_t;
count: ::core::libc::size_t) -> ::core::libc::ssize_t;
}
#[abi = "cdecl"]

View File

@ -12,7 +12,7 @@
extern mod std;
use core::vec::*;
use ::core::vec::*;
fn main() {
let mut v = from_elem(0u, 0);

View File

@ -10,9 +10,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use core::cast;
use core::libc::{c_double, c_int};
use core::f64::*;
use ::core::cast;
use ::core::libc::{c_double, c_int};
use ::core::f64::*;
fn to_c_int(v: &mut int) -> &mut c_int unsafe {
cast::reinterpret_cast(&v)

View File

@ -12,7 +12,7 @@
// tjc: I don't know why
pub mod pipes {
use core::cast::{forget, transmute};
use ::core::cast::{forget, transmute};
pub enum state {
empty,
@ -50,7 +50,7 @@ pub mod pipes {
pub fn atomic_xchg_rel(_dst: &mut int, _src: int) -> int { fail; }
}
// We should consider moving this to core::unsafe, although I
// We should consider moving this to ::core::unsafe, although I
// suspect graydon would want us to use void pointers instead.
pub unsafe fn uniquify<T>(+x: *T) -> ~T {
unsafe { cast::transmute(move x) }
@ -212,8 +212,8 @@ pub mod pipes {
}
pub mod pingpong {
use core::cast;
use core::ptr;
use ::core::cast;
use ::core::ptr;
pub enum ping = ::pipes::send_packet<pong>;
pub enum pong = ::pipes::send_packet<ping>;
@ -241,7 +241,7 @@ pub mod pingpong {
}
pub mod client {
use core::option;
use ::core::option;
use pingpong;
pub type ping = ::pipes::send_packet<pingpong::ping>;

View File

@ -13,7 +13,7 @@
// rustc --test map_to_str.rs && ./map_to_str
extern mod std;
use core::io::{WriterUtil};
use ::core::io::{WriterUtil};
use std::map::*;
#[cfg(test)]

View File

@ -13,7 +13,7 @@
// Incorrect struct size computation in the FFI, because of not taking
// the alignment of elements into account.
use core::libc::*;
use ::core::libc::*;
struct KEYGEN {
hash_algorithm: [c_uint * 2],

View File

@ -15,19 +15,19 @@
https://github.com/graydon/rust/issues/507
*/
fn grandchild(c: core::oldcomm::Chan<int>) { core::oldcomm::send(c, 42); }
fn grandchild(c: ::core::oldcomm::Chan<int>) { ::core::oldcomm::send(c, 42); }
fn child(c: core::oldcomm::Chan<int>) {
fn child(c: ::core::oldcomm::Chan<int>) {
task::spawn(|| grandchild(c) )
}
fn main() {
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
task::spawn(|| child(ch) );
let x: int = core::oldcomm::recv(p);
let x: int = ::core::oldcomm::recv(p);
log(debug, x);

View File

@ -10,18 +10,18 @@
enum msg { closed, received(~[u8]), }
fn producer(c: core::oldcomm::Chan<~[u8]>) {
core::oldcomm::send(c, ~[1u8, 2u8, 3u8, 4u8]);
fn producer(c: ::core::oldcomm::Chan<~[u8]>) {
::core::oldcomm::send(c, ~[1u8, 2u8, 3u8, 4u8]);
let empty: ~[u8] = ~[];
core::oldcomm::send(c, empty);
::core::oldcomm::send(c, empty);
}
fn packager(cb: core::oldcomm::Chan<core::oldcomm::Chan<~[u8]>>, msg: core::oldcomm::Chan<msg>) {
let p: core::oldcomm::Port<~[u8]> = core::oldcomm::Port();
core::oldcomm::send(cb, core::oldcomm::Chan(&p));
fn packager(cb: ::core::oldcomm::Chan<::core::oldcomm::Chan<~[u8]>>, msg: ::core::oldcomm::Chan<msg>) {
let p: ::core::oldcomm::Port<~[u8]> = ::core::oldcomm::Port();
::core::oldcomm::send(cb, ::core::oldcomm::Chan(&p));
loop {
debug!("waiting for bytes");
let data = core::oldcomm::recv(p);
let data = ::core::oldcomm::recv(p);
debug!("got bytes");
if vec::len(data) == 0u {
debug!("got empty bytes, quitting");
@ -29,26 +29,26 @@ fn packager(cb: core::oldcomm::Chan<core::oldcomm::Chan<~[u8]>>, msg: core::oldc
}
debug!("sending non-empty buffer of length");
log(debug, vec::len(data));
core::oldcomm::send(msg, received(data));
::core::oldcomm::send(msg, received(data));
debug!("sent non-empty buffer");
}
debug!("sending closed message");
core::oldcomm::send(msg, closed);
::core::oldcomm::send(msg, closed);
debug!("sent closed message");
}
fn main() {
let p: core::oldcomm::Port<msg> = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let recv_reader: core::oldcomm::Port<core::oldcomm::Chan<~[u8]>> = core::oldcomm::Port();
let recv_reader_chan = core::oldcomm::Chan(&recv_reader);
let p: ::core::oldcomm::Port<msg> = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
let recv_reader: ::core::oldcomm::Port<::core::oldcomm::Chan<~[u8]>> = ::core::oldcomm::Port();
let recv_reader_chan = ::core::oldcomm::Chan(&recv_reader);
let pack = task::spawn(|| packager(recv_reader_chan, ch) );
let source_chan: core::oldcomm::Chan<~[u8]> = core::oldcomm::recv(recv_reader);
let source_chan: ::core::oldcomm::Chan<~[u8]> = ::core::oldcomm::recv(recv_reader);
let prod = task::spawn(|| producer(source_chan) );
loop {
let msg = core::oldcomm::recv(p);
let msg = ::core::oldcomm::recv(p);
match msg {
closed => { debug!("Got close message"); break; }
received(data) => {

View File

@ -10,14 +10,14 @@
fn a() {
fn doit() {
fn b(c: core::oldcomm::Chan<core::oldcomm::Chan<int>>) {
let p = core::oldcomm::Port();
core::oldcomm::send(c, core::oldcomm::Chan(&p));
fn b(c: ::core::oldcomm::Chan<::core::oldcomm::Chan<int>>) {
let p = ::core::oldcomm::Port();
::core::oldcomm::send(c, ::core::oldcomm::Chan(&p));
}
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
task::spawn(|| b(ch) );
core::oldcomm::recv(p);
::core::oldcomm::recv(p);
}
let mut i = 0;
while i < 100 {

View File

@ -1,13 +1,13 @@
fn producer(c: core::oldcomm::Chan<~[u8]>) {
core::oldcomm::send(c,
fn producer(c: ::core::oldcomm::Chan<~[u8]>) {
::core::oldcomm::send(c,
~[1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8, 8u8, 9u8, 10u8, 11u8, 12u8,
13u8]);
}
fn main() {
let p: core::oldcomm::Port<~[u8]> = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p: ::core::oldcomm::Port<~[u8]> = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
let prod = task::spawn(|| producer(ch) );
let data: ~[u8] = core::oldcomm::recv(p);
let data: ~[u8] = ::core::oldcomm::recv(p);
}

View File

@ -10,21 +10,21 @@
// except according to those terms.
fn main() {
let p = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&p);
let mut y: int;
task::spawn(|| child(ch) );
y = core::oldcomm::recv(p);
y = ::core::oldcomm::recv(p);
debug!("received 1");
log(debug, y);
assert (y == 10);
task::spawn(|| child(ch) );
y = core::oldcomm::recv(p);
y = ::core::oldcomm::recv(p);
debug!("received 2");
log(debug, y);
assert (y == 10);
}
fn child(c: core::oldcomm::Chan<int>) { core::oldcomm::send(c, 10); }
fn child(c: ::core::oldcomm::Chan<int>) { ::core::oldcomm::send(c, 10); }

View File

@ -18,7 +18,7 @@
mod m {
#[legacy_exports];
use core::vec;
use ::core::vec;
fn f() -> ~[int] { vec::from_elem(1u, 0) }
}

View File

@ -18,8 +18,8 @@
// This was generated initially by the pipe compiler, but it's been
// modified in hopefully straightforward ways.
mod pingpong {
use core::pipes::*;
use core::ptr;
use ::core::pipes::*;
use ::core::ptr;
pub type packets = {
ping: Packet<ping>,
@ -43,7 +43,7 @@ mod pingpong {
pub enum ping = server::pong;
pub enum pong = client::ping;
pub mod client {
use core::ptr;
use ::core::ptr;
pub fn ping(+pipe: ping) -> pong {
{
@ -61,7 +61,7 @@ mod pingpong {
::pingpong::packets>;
}
pub mod server {
use core::ptr;
use ::core::ptr;
pub type ping = pipes::RecvPacketBuffered<::pingpong::ping,
::pingpong::packets>;

View File

@ -12,7 +12,7 @@
// An example to make sure the protocol parsing syntax extension works.
use core::option;
use ::core::option;
proto! pingpong (
ping:send {
@ -25,7 +25,7 @@ proto! pingpong (
)
mod test {
use core::pipes::recv;
use ::core::pipes::recv;
use pingpong::{ping, pong};
pub fn client(-chan: ::pingpong::client::ping) {

View File

@ -13,7 +13,7 @@
// Regression tests for circular_buffer when using a unit
// that has a size that is not a power of two
// A 12-byte unit to core::oldcomm::send over the channel
// A 12-byte unit to ::core::oldcomm::send over the channel
type record = {val1: u32, val2: u32, val3: u32};
@ -22,52 +22,52 @@ type record = {val1: u32, val2: u32, val3: u32};
// power of two so needs to be rounded up. Don't trigger any
// assertions.
fn test_init() {
let myport = core::oldcomm::Port();
let mychan = core::oldcomm::Chan(&myport);
let myport = ::core::oldcomm::Port();
let mychan = ::core::oldcomm::Chan(&myport);
let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
core::oldcomm::send(mychan, val);
::core::oldcomm::send(mychan, val);
}
// Dump lots of items into the channel so it has to grow.
// Don't trigger any assertions.
fn test_grow() {
let myport = core::oldcomm::Port();
let mychan = core::oldcomm::Chan(&myport);
let myport = ::core::oldcomm::Port();
let mychan = ::core::oldcomm::Chan(&myport);
for uint::range(0u, 100u) |i| {
let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
core::oldcomm::send(mychan, val);
::core::oldcomm::send(mychan, val);
}
}
// Don't allow the buffer to shrink below it's original size
fn test_shrink1() {
let myport = core::oldcomm::Port();
let mychan = core::oldcomm::Chan(&myport);
core::oldcomm::send(mychan, 0i8);
let x = core::oldcomm::recv(myport);
let myport = ::core::oldcomm::Port();
let mychan = ::core::oldcomm::Chan(&myport);
::core::oldcomm::send(mychan, 0i8);
let x = ::core::oldcomm::recv(myport);
}
fn test_shrink2() {
let myport = core::oldcomm::Port();
let mychan = core::oldcomm::Chan(&myport);
let myport = ::core::oldcomm::Port();
let mychan = ::core::oldcomm::Chan(&myport);
for uint::range(0u, 100u) |_i| {
let val: record = {val1: 0u32, val2: 0u32, val3: 0u32};
core::oldcomm::send(mychan, val);
::core::oldcomm::send(mychan, val);
}
for uint::range(0u, 100u) |_i| { let x = core::oldcomm::recv(myport); }
for uint::range(0u, 100u) |_i| { let x = ::core::oldcomm::recv(myport); }
}
// Test rotating the buffer when the unit size is not a power of two
fn test_rotate() {
let myport = core::oldcomm::Port();
let mychan = core::oldcomm::Chan(&myport);
let myport = ::core::oldcomm::Port();
let mychan = ::core::oldcomm::Chan(&myport);
for uint::range(0u, 100u) |i| {
let val = {val1: i as u32, val2: i as u32, val3: i as u32};
core::oldcomm::send(mychan, val);
let x = core::oldcomm::recv(myport);
::core::oldcomm::send(mychan, val);
let x = ::core::oldcomm::recv(myport);
assert (x.val1 == i as u32);
assert (x.val2 == i as u32);
assert (x.val3 == i as u32);
@ -78,16 +78,16 @@ fn test_rotate() {
// Test rotating and growing the buffer when
// the unit size is not a power of two
fn test_rotate_grow() {
let myport = core::oldcomm::Port::<record>();
let mychan = core::oldcomm::Chan(&myport);
let myport = ::core::oldcomm::Port::<record>();
let mychan = ::core::oldcomm::Chan(&myport);
for uint::range(0u, 10u) |j| {
for uint::range(0u, 10u) |i| {
let val: record =
{val1: i as u32, val2: i as u32, val3: i as u32};
core::oldcomm::send(mychan, val);
::core::oldcomm::send(mychan, val);
}
for uint::range(0u, 10u) |i| {
let x = core::oldcomm::recv(myport);
let x = ::core::oldcomm::recv(myport);
assert (x.val1 == i as u32);
assert (x.val2 == i as u32);
assert (x.val3 == i as u32);

View File

@ -23,12 +23,12 @@ fn test(f: int) -> test {
}
fn main() {
let p = core::oldcomm::Port();
let c = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let c = ::core::oldcomm::Chan(&p);
do task::spawn() {
let p = core::oldcomm::Port();
c.send(core::oldcomm::Chan(&p));
let p = ::core::oldcomm::Port();
c.send(::core::oldcomm::Chan(&p));
let _r = p.recv();
}

View File

@ -13,7 +13,7 @@
extern mod mycore(name ="static_fn_inline_xc_aux");
use mycore::num;
use my::core::num;
fn main() {
let _1:float = num::Num2::from_int2(1i);

View File

@ -3,7 +3,7 @@
extern mod mycore(name ="static_fn_trait_xc_aux");
use mycore::num;
use my::core::num;
fn main() {
let _1:float = num::Num2::from_int2(1i);

View File

@ -17,12 +17,12 @@ fn main() {
test06();
}
fn test00_start(ch: core::oldcomm::Chan<int>, message: int, count: int) {
fn test00_start(ch: ::core::oldcomm::Chan<int>, message: int, count: int) {
debug!("Starting test00_start");
let mut i: int = 0;
while i < count {
debug!("Sending Message");
core::oldcomm::send(ch, message + 0);
::core::oldcomm::send(ch, message + 0);
i = i + 1;
}
debug!("Ending test00_start");
@ -33,8 +33,8 @@ fn test00() {
let number_of_messages: int = 4;
debug!("Creating tasks");
let po = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&po);
let po = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&po);
let mut i: int = 0;
@ -50,7 +50,7 @@ fn test00() {
let mut sum: int = 0;
for results.each |r| {
i = 0;
while i < number_of_messages { sum += core::oldcomm::recv(po); i = i + 1; }
while i < number_of_messages { sum += ::core::oldcomm::recv(po); i = i + 1; }
}
for results.each |r| { r.recv(); }
@ -63,19 +63,19 @@ fn test00() {
}
fn test01() {
let p = core::oldcomm::Port();
let p = ::core::oldcomm::Port();
debug!("Reading from a port that is never written to.");
let value: int = core::oldcomm::recv(p);
let value: int = ::core::oldcomm::recv(p);
log(debug, value);
}
fn test02() {
let p = core::oldcomm::Port();
let c = core::oldcomm::Chan(&p);
let p = ::core::oldcomm::Port();
let c = ::core::oldcomm::Chan(&p);
debug!("Writing to a local task channel.");
core::oldcomm::send(c, 42);
::core::oldcomm::send(c, 42);
debug!("Reading from a local task port.");
let value: int = core::oldcomm::recv(p);
let value: int = ::core::oldcomm::recv(p);
log(debug, value);
}
@ -93,22 +93,22 @@ fn test04() {
debug!("Finishing up.");
}
fn test05_start(ch: core::oldcomm::Chan<int>) {
core::oldcomm::send(ch, 10);
core::oldcomm::send(ch, 20);
core::oldcomm::send(ch, 30);
core::oldcomm::send(ch, 30);
core::oldcomm::send(ch, 30);
fn test05_start(ch: ::core::oldcomm::Chan<int>) {
::core::oldcomm::send(ch, 10);
::core::oldcomm::send(ch, 20);
::core::oldcomm::send(ch, 30);
::core::oldcomm::send(ch, 30);
::core::oldcomm::send(ch, 30);
}
fn test05() {
let po = core::oldcomm::Port();
let ch = core::oldcomm::Chan(&po);
let po = ::core::oldcomm::Port();
let ch = ::core::oldcomm::Chan(&po);
task::spawn(|| test05_start(ch) );
let mut value: int;
value = core::oldcomm::recv(po);
value = core::oldcomm::recv(po);
value = core::oldcomm::recv(po);
value = ::core::oldcomm::recv(po);
value = ::core::oldcomm::recv(po);
value = ::core::oldcomm::recv(po);
log(debug, value);
}

View File

@ -1,3 +1,5 @@
// xfail-fast
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.

View File

@ -14,7 +14,7 @@
extern mod core;
use core::{str, int, vec};
use ::core::{str, int, vec};
trait to_str {
fn to_str() -> ~str;

View File

@ -16,12 +16,12 @@ extern mod zed(name = "core");
extern mod bar(name = "core", vers = "0.6");
use core::str;
use ::core::str;
use x = zed::str;
mod baz {
#[legacy_exports];
use bar::str;
use x = core::str;
use x = ::core::str;
}
fn main() { }

View File

@ -1,22 +1,22 @@
fn main() {
let x = @[1, 2, 3];
match x {
[2, .._] => core::util::unreachable(),
[2, .._] => ::core::util::unreachable(),
[1, ..tail] => {
assert tail == [2, 3];
}
[_] => core::util::unreachable(),
[] => core::util::unreachable()
[_] => ::core::util::unreachable(),
[] => ::core::util::unreachable()
}
let y = (~[(1, true), (2, false)], 0.5);
match y {
([_, _, _], 0.5) => core::util::unreachable(),
([_, _, _], 0.5) => ::core::util::unreachable(),
([(1, a), (b, false), ..tail], _) => {
assert a == true;
assert b == 2;
assert tail.is_empty();
}
([..tail], _) => core::util::unreachable()
([..tail], _) => ::core::util::unreachable()
}
}

View File

@ -3,7 +3,7 @@ fn main() {
if !x.is_empty() {
let el = match x {
[1, ..ref tail] => &tail[0],
_ => core::util::unreachable()
_ => ::core::util::unreachable()
};
io::println(fmt!("%d", *el));
}

View File

@ -14,7 +14,7 @@ fn main() {
let x = [1, 2, 3, 4, 5];
match x {
[a, b, c, d, e, f] => {
core::util::unreachable();
::core::util::unreachable();
}
[a, b, c, d, e] => {
assert a == 1;
@ -24,7 +24,7 @@ fn main() {
assert e == 5;
}
_ => {
core::util::unreachable();
::core::util::unreachable();
}
}

View File

@ -17,19 +17,19 @@ fn main() {
match tail {
[Foo { _ }, _, Foo { _ }, ..tail] => {
core::util::unreachable();
::core::util::unreachable();
}
[Foo { string: a }, Foo { string: b }] => {
assert a == ~"bar";
assert b == ~"baz";
}
_ => {
core::util::unreachable();
::core::util::unreachable();
}
}
}
_ => {
core::util::unreachable();
::core::util::unreachable();
}
}
}