mod tests {
use super::*;
use prelude::*;
- use realstd::fmt::{String};
fn same(fmt: &'static str, p: ~[Piece<'static>]) {
let mut parser = Parser::new(fmt);
use cast;
use clone::Clone;
+#[cfg(not(test))]
use cmp::Equiv;
use iterator::{range, Iterator};
use option::{Option, Some, None};
use parse::token::{str_to_ident};
use util::parser_testing::{string_to_tts_and_sess, string_to_parser};
use util::parser_testing::{string_to_expr, string_to_item};
- use util::parser_testing::{string_to_stmt, strs_to_idents};
+ use util::parser_testing::string_to_stmt;
// map a string to tts, return the tt without its parsesess
fn string_to_tts_only(source_str : @str) -> ~[ast::token_tree] {
use std::os;
use std::result::{Ok, Err};
use std::task;
-use std::u64;
use std::uint;
fn fib(n: int) -> int {
extern mod cci_const;
use cci_const::bar;
-use std::cast::transmute;
static foo: extern "C" fn() = bar;
pub fn main() {
- unsafe {
- assert_eq!(foo, bar);
- }
+ assert_eq!(foo, bar);
}
}
pub fn main() {
- unsafe {
- assert_eq!(foopy, f);
- assert_eq!(f, s.f);
- }
+ assert_eq!(foopy, f);
+ assert_eq!(f, s.f);
}
extern fn uintret() -> uint { 22 }
-extern fn uintvoidret(x: uint) {}
+extern fn uintvoidret(_x: uint) {}
extern fn uintuintuintuintret(x: uint, y: uint, z: uint) -> uint { x+y+z }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::cast::transmute;
-
extern fn f() {
}
}
pub fn main() {
- unsafe {
- let a: extern "C" fn() = f;
- let b: extern "C" fn() = f;
- let c: extern "C" fn() = g;
+ let a: extern "C" fn() = f;
+ let b: extern "C" fn() = f;
+ let c: extern "C" fn() = g;
- assert_eq!(a, b);
- assert!(a != c);
- }
+ assert_eq!(a, b);
+ assert!(a != c);
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use std::io;
-
struct T (&'static [int]);
static t : T = T (&'static [5, 4, 3]);
fn main () {
// xfail-fast
-use std::int;
-
trait vec_monad<A> {
fn bind<B>(&self, f: &fn(&A) -> ~[B]) -> ~[B];
}
// xfail-fast
-use std::int;
use std::libc::c_void;
use std::ptr;
use std::sys;
// xfail-fast
-use std::uint;
-
pub trait plus {
fn plus(&self) -> int;
}
// xfail-fast
-use std::int;
-
trait to_str {
fn to_string(&self) -> ~str;
}