auto merge of #7441 : catamorphism/rust/testcases_2013-06-27, r=catamorphism
This commit is contained in:
commit
0326b0abed
5 changed files with 149 additions and 0 deletions
29
src/test/compile-fail/issue-5060-fail.rs
Normal file
29
src/test/compile-fail/issue-5060-fail.rs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
macro_rules! print_hd_tl (
|
||||||
|
($field_hd:ident, $($field_tl:ident),+) => ({
|
||||||
|
io::print(stringify!($field)); //~ ERROR unknown macro variable
|
||||||
|
io::print("::[");
|
||||||
|
$(
|
||||||
|
io::print(stringify!($field_tl));
|
||||||
|
io::print(", ");
|
||||||
|
)+
|
||||||
|
io::print("]\n");
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
print_hd_tl!(x, y, z, w)
|
||||||
|
}
|
||||||
|
|
21
src/test/run-pass/issue-4446.rs
Normal file
21
src/test/run-pass/issue-4446.rs
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
use std::{pipes, io, task, comm};
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let (port, chan) = comm::stream();
|
||||||
|
|
||||||
|
do task::spawn {
|
||||||
|
io::println(port.recv());
|
||||||
|
}
|
||||||
|
|
||||||
|
chan.send("hello, world");
|
||||||
|
}
|
28
src/test/run-pass/issue-5060.rs
Normal file
28
src/test/run-pass/issue-5060.rs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
macro_rules! print_hd_tl (
|
||||||
|
($field_hd:ident, $($field_tl:ident),+) => ({
|
||||||
|
io::print(stringify!($field_hd));
|
||||||
|
io::print("::[");
|
||||||
|
$(
|
||||||
|
io::print(stringify!($field_tl));
|
||||||
|
io::print(", ");
|
||||||
|
)+
|
||||||
|
io::print("]\n");
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
print_hd_tl!(x, y, z, w)
|
||||||
|
}
|
||||||
|
|
44
src/test/run-pass/issue-5192.rs
Normal file
44
src/test/run-pass/issue-5192.rs
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
pub trait EventLoop {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct UvEventLoop {
|
||||||
|
uvio: int
|
||||||
|
}
|
||||||
|
|
||||||
|
impl UvEventLoop {
|
||||||
|
pub fn new() -> UvEventLoop {
|
||||||
|
UvEventLoop {
|
||||||
|
uvio: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl EventLoop for UvEventLoop {
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Scheduler {
|
||||||
|
event_loop: ~EventLoop,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Scheduler {
|
||||||
|
|
||||||
|
pub fn new(event_loop: ~EventLoop) -> Scheduler {
|
||||||
|
Scheduler {
|
||||||
|
event_loop: event_loop,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let mut sched = Scheduler::new(~UvEventLoop::new() as ~EventLoop);
|
||||||
|
}
|
27
src/test/run-pass/issue-5280.rs
Normal file
27
src/test/run-pass/issue-5280.rs
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
// xfail-test
|
||||||
|
|
||||||
|
type FontTableTag = u32;
|
||||||
|
|
||||||
|
trait FontTableTagConversions {
|
||||||
|
fn tag_to_str(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FontTableTagConversions for FontTableTag {
|
||||||
|
fn tag_to_str(self) {
|
||||||
|
&self;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
5.tag_to_str();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue