提交 3bbbb314 编写于 作者: B bors

auto merge of #6327 : z0w0/rust/rm-notest, r=brson

Makes it more consistent, imo.
......@@ -166,7 +166,7 @@ pub fn from_slice<T:Copy>(v: &[T]) -> @[T] {
from_fn(v.len(), |i| v[i])
}
#[cfg(notest)]
#[cfg(not(test))]
pub mod traits {
use at_vec::append;
use kinds::Copy;
......
......@@ -10,7 +10,7 @@
//! Boolean logic
#[cfg(notest)]
#[cfg(not(test))]
use cmp::{Eq, Ord, TotalOrd, Ordering};
use option::{None, Option, Some};
use from_str::FromStr;
......@@ -75,7 +75,7 @@ pub fn all_values(blk: &fn(v: bool)) {
#[inline(always)]
pub fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for bool {
#[inline(always)]
fn lt(&self, other: &bool) -> bool { to_bit(*self) < to_bit(*other) }
......@@ -87,13 +87,13 @@ fn gt(&self, other: &bool) -> bool { to_bit(*self) > to_bit(*other) }
fn ge(&self, other: &bool) -> bool { to_bit(*self) >= to_bit(*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalOrd for bool {
#[inline(always)]
fn cmp(&self, other: &bool) -> Ordering { to_bit(*self).cmp(&to_bit(*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for bool {
#[inline(always)]
fn eq(&self, other: &bool) -> bool { (*self) == (*other) }
......
......@@ -10,7 +10,7 @@
//! Utilities for manipulating the char type
#[cfg(notest)]
#[cfg(not(test))]
use cmp::Ord;
use option::{None, Option, Some};
use str;
......@@ -18,7 +18,7 @@
use uint;
use unicode::{derived_property, general_category};
#[cfg(notest)] use cmp::Eq;
#[cfg(not(test))] use cmp::Eq;
/*
Lu Uppercase_Letter an uppercase letter
......@@ -244,7 +244,7 @@ pub fn len_utf8_bytes(c: char) -> uint {
else { fail!(~"invalid character!") }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for char {
#[inline(always)]
fn eq(&self, other: &char) -> bool { (*self) == (*other) }
......@@ -252,7 +252,7 @@ fn eq(&self, other: &char) -> bool { (*self) == (*other) }
fn ne(&self, other: &char) -> bool { (*self) != (*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for char {
#[inline(always)]
fn lt(&self, other: &char) -> bool { *self < *other }
......
......@@ -15,9 +15,9 @@
use repr::BoxRepr;
use sys::TypeDesc;
use cast::transmute;
#[cfg(notest)] use unstable::lang::clear_task_borrow_list;
#[cfg(not(test))] use unstable::lang::clear_task_borrow_list;
#[cfg(notest)] use ptr::to_unsafe_ptr;
#[cfg(not(test))] use ptr::to_unsafe_ptr;
/**
* Runtime structures
......@@ -164,7 +164,7 @@ fn debug_mem() -> bool {
}
/// Destroys all managed memory (i.e. @ boxes) held by the current task.
#[cfg(notest)]
#[cfg(not(test))]
#[lang="annihilate"]
pub unsafe fn annihilate() {
use unstable::lang::local_free;
......
......@@ -179,9 +179,9 @@ pub mod managed;
/* Core language traits */
#[cfg(notest)] pub mod kinds;
#[cfg(notest)] pub mod ops;
#[cfg(notest)] pub mod cmp;
#[cfg(not(test))] pub mod kinds;
#[cfg(not(test))] pub mod ops;
#[cfg(not(test))] pub mod cmp;
/* Common traits */
......
......@@ -42,7 +42,7 @@ pub fn console_off() {
}
}
#[cfg(notest)]
#[cfg(not(test))]
#[lang="log_type"]
pub fn log_type<T>(level: u32, object: &T) {
use cast::transmute;
......
......@@ -12,7 +12,7 @@
use ptr::to_unsafe_ptr;
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(not(test))] use cmp::{Eq, Ord};
pub mod raw {
use intrinsic::TyDesc;
......@@ -49,7 +49,7 @@ pub fn mut_ptr_eq<T>(a: @mut T, b: @mut T) -> bool {
a_ptr == b_ptr
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Eq> Eq for @T {
#[inline(always)]
fn eq(&self, other: &@T) -> bool { *(*self) == *(*other) }
......@@ -57,7 +57,7 @@ fn eq(&self, other: &@T) -> bool { *(*self) == *(*other) }
fn ne(&self, other: &@T) -> bool { *(*self) != *(*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Eq> Eq for @mut T {
#[inline(always)]
fn eq(&self, other: &@mut T) -> bool { *(*self) == *(*other) }
......@@ -65,7 +65,7 @@ fn eq(&self, other: &@mut T) -> bool { *(*self) == *(*other) }
fn ne(&self, other: &@mut T) -> bool { *(*self) != *(*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Ord> Ord for @T {
#[inline(always)]
fn lt(&self, other: &@T) -> bool { *(*self) < *(*other) }
......@@ -77,7 +77,7 @@ fn ge(&self, other: &@T) -> bool { *(*self) >= *(*other) }
fn gt(&self, other: &@T) -> bool { *(*self) > *(*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Ord> Ord for @mut T {
#[inline(always)]
fn lt(&self, other: &@mut T) -> bool { *(*self) < *(*other) }
......
......@@ -14,10 +14,10 @@
*/
#[cfg(notest)]
#[cfg(not(test))]
use prelude::*;
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for () {
#[inline(always)]
fn eq(&self, _other: &()) -> bool { true }
......@@ -25,7 +25,7 @@ fn eq(&self, _other: &()) -> bool { true }
fn ne(&self, _other: &()) -> bool { false }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for () {
#[inline(always)]
fn lt(&self, _other: &()) -> bool { false }
......@@ -37,13 +37,13 @@ fn ge(&self, _other: &()) -> bool { true }
fn gt(&self, _other: &()) -> bool { false }
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalOrd for () {
#[inline(always)]
fn cmp(&self, _other: &()) -> Ordering { Equal }
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalEq for () {
#[inline(always)]
fn equals(&self, _other: &()) -> bool { true }
......
......@@ -198,7 +198,7 @@ pub mod consts {
impl Num for f32 {}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for f32 {
#[inline(always)]
fn eq(&self, other: &f32) -> bool { (*self) == (*other) }
......@@ -206,7 +206,7 @@ fn eq(&self, other: &f32) -> bool { (*self) == (*other) }
fn ne(&self, other: &f32) -> bool { (*self) != (*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl ApproxEq<f32> for f32 {
#[inline(always)]
fn approx_epsilon() -> f32 { 1.0e-6 }
......@@ -222,7 +222,7 @@ fn approx_eq_eps(&self, other: &f32, approx_epsilon: &f32) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for f32 {
#[inline(always)]
fn lt(&self, other: &f32) -> bool { (*self) < (*other) }
......@@ -272,37 +272,37 @@ impl One for f32 {
fn one() -> f32 { 1.0 }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Add<f32,f32> for f32 {
#[inline(always)]
fn add(&self, other: &f32) -> f32 { *self + *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Sub<f32,f32> for f32 {
#[inline(always)]
fn sub(&self, other: &f32) -> f32 { *self - *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Mul<f32,f32> for f32 {
#[inline(always)]
fn mul(&self, other: &f32) -> f32 { *self * *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Div<f32,f32> for f32 {
#[inline(always)]
fn div(&self, other: &f32) -> f32 { *self / *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Rem<f32,f32> for f32 {
#[inline(always)]
fn rem(&self, other: &f32) -> f32 { *self % *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Neg<f32> for f32 {
#[inline(always)]
fn neg(&self) -> f32 { -*self }
......
......@@ -221,7 +221,7 @@ pub mod consts {
impl Num for f64 {}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for f64 {
#[inline(always)]
fn eq(&self, other: &f64) -> bool { (*self) == (*other) }
......@@ -229,7 +229,7 @@ fn eq(&self, other: &f64) -> bool { (*self) == (*other) }
fn ne(&self, other: &f64) -> bool { (*self) != (*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl ApproxEq<f64> for f64 {
#[inline(always)]
fn approx_epsilon() -> f64 { 1.0e-6 }
......@@ -245,7 +245,7 @@ fn approx_eq_eps(&self, other: &f64, approx_epsilon: &f64) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for f64 {
#[inline(always)]
fn lt(&self, other: &f64) -> bool { (*self) < (*other) }
......@@ -295,28 +295,28 @@ impl One for f64 {
fn one() -> f64 { 1.0 }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Add<f64,f64> for f64 {
fn add(&self, other: &f64) -> f64 { *self + *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Sub<f64,f64> for f64 {
fn sub(&self, other: &f64) -> f64 { *self - *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Mul<f64,f64> for f64 {
fn mul(&self, other: &f64) -> f64 { *self * *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Div<f64,f64> for f64 {
fn div(&self, other: &f64) -> f64 { *self / *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Rem<f64,f64> for f64 {
#[inline(always)]
fn rem(&self, other: &f64) -> f64 { *self % *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Neg<f64> for f64 {
fn neg(&self) -> f64 { -*self }
}
......
......@@ -363,7 +363,7 @@ pub fn tan(x: float) -> float {
impl Num for float {}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for float {
#[inline(always)]
fn eq(&self, other: &float) -> bool { (*self) == (*other) }
......@@ -371,7 +371,7 @@ fn eq(&self, other: &float) -> bool { (*self) == (*other) }
fn ne(&self, other: &float) -> bool { (*self) != (*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl ApproxEq<float> for float {
#[inline(always)]
fn approx_epsilon() -> float { 1.0e-6 }
......@@ -387,7 +387,7 @@ fn approx_eq_eps(&self, other: &float, approx_epsilon: &float) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for float {
#[inline(always)]
fn lt(&self, other: &float) -> bool { (*self) < (*other) }
......@@ -695,36 +695,36 @@ fn y1(&self) -> float { y1(*self as f64) as float }
fn yn(&self, n: int) -> float { yn(n as c_int, *self as f64) as float }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Add<float,float> for float {
#[inline(always)]
fn add(&self, other: &float) -> float { *self + *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Sub<float,float> for float {
#[inline(always)]
fn sub(&self, other: &float) -> float { *self - *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Mul<float,float> for float {
#[inline(always)]
fn mul(&self, other: &float) -> float { *self * *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Div<float,float> for float {
#[inline(always)]
fn div(&self, other: &float) -> float { *self / *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Rem<float,float> for float {
#[inline(always)]
fn rem(&self, other: &float) -> float { *self % *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Neg<float> for float {
#[inline(always)]
fn neg(&self) -> float { -*self }
......
......@@ -131,7 +131,7 @@ pub fn abs(i: T) -> T { i.abs() }
impl Num for T {}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for T {
#[inline(always)]
fn lt(&self, other: &T) -> bool { return (*self) < (*other); }
......@@ -143,7 +143,7 @@ impl Ord for T {
fn gt(&self, other: &T) -> bool { return (*self) > (*other); }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for T {
#[inline(always)]
fn eq(&self, other: &T) -> bool { return (*self) == (*other); }
......@@ -182,25 +182,25 @@ impl One for T {
fn one() -> T { 1 }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Add<T,T> for T {
#[inline(always)]
fn add(&self, other: &T) -> T { *self + *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Sub<T,T> for T {
#[inline(always)]
fn sub(&self, other: &T) -> T { *self - *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Mul<T,T> for T {
#[inline(always)]
fn mul(&self, other: &T) -> T { *self * *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Div<T,T> for T {
///
/// Integer division, truncated towards 0. As this behaviour reflects the underlying
......@@ -224,7 +224,7 @@ impl Div<T,T> for T {
fn div(&self, other: &T) -> T { *self / *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Rem<T,T> for T {
///
/// Returns the integer remainder after division, satisfying:
......@@ -251,7 +251,7 @@ impl Rem<T,T> for T {
fn rem(&self, other: &T) -> T { *self % *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Neg<T> for T {
#[inline(always)]
fn neg(&self) -> T { -*self }
......@@ -417,37 +417,37 @@ fn is_odd(&self) -> bool { !self.is_even() }
impl Bitwise for T {}
#[cfg(notest)]
#[cfg(not(test))]
impl BitOr<T,T> for T {
#[inline(always)]
fn bitor(&self, other: &T) -> T { *self | *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl BitAnd<T,T> for T {
#[inline(always)]
fn bitand(&self, other: &T) -> T { *self & *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl BitXor<T,T> for T {
#[inline(always)]
fn bitxor(&self, other: &T) -> T { *self ^ *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Shl<T,T> for T {
#[inline(always)]
fn shl(&self, other: &T) -> T { *self << *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Shr<T,T> for T {
#[inline(always)]
fn shr(&self, other: &T) -> T { *self >> *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Not<T> for T {
#[inline(always)]
fn not(&self) -> T { !*self }
......
......@@ -96,7 +96,7 @@ pub fn compl(i: T) -> T {
impl Num for T {}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for T {
#[inline(always)]
fn lt(&self, other: &T) -> bool { (*self) < (*other) }
......@@ -108,7 +108,7 @@ fn ge(&self, other: &T) -> bool { (*self) >= (*other) }
fn gt(&self, other: &T) -> bool { (*self) > (*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for T {
#[inline(always)]
fn eq(&self, other: &T) -> bool { return (*self) == (*other); }
......@@ -147,37 +147,37 @@ impl One for T {
fn one() -> T { 1 }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Add<T,T> for T {
#[inline(always)]
fn add(&self, other: &T) -> T { *self + *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Sub<T,T> for T {
#[inline(always)]
fn sub(&self, other: &T) -> T { *self - *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Mul<T,T> for T {
#[inline(always)]
fn mul(&self, other: &T) -> T { *self * *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Div<T,T> for T {
#[inline(always)]
fn div(&self, other: &T) -> T { *self / *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Rem<T,T> for T {
#[inline(always)]
fn rem(&self, other: &T) -> T { *self % *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Neg<T> for T {
#[inline(always)]
fn neg(&self) -> T { -*self }
......@@ -240,37 +240,37 @@ fn is_odd(&self) -> bool { !self.is_even() }
impl Bitwise for T {}
#[cfg(notest)]
#[cfg(not(test))]
impl BitOr<T,T> for T {
#[inline(always)]
fn bitor(&self, other: &T) -> T { *self | *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl BitAnd<T,T> for T {
#[inline(always)]
fn bitand(&self, other: &T) -> T { *self & *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl BitXor<T,T> for T {
#[inline(always)]
fn bitxor(&self, other: &T) -> T { *self ^ *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Shl<T,T> for T {
#[inline(always)]
fn shl(&self, other: &T) -> T { *self << *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Shr<T,T> for T {
#[inline(always)]
fn shr(&self, other: &T) -> T { *self >> *other }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Not<T> for T {
#[inline(always)]
fn not(&self) -> T { !*self }
......
......@@ -10,9 +10,9 @@
//! Operations on unique pointer types
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(not(test))] use cmp::{Eq, Ord};
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Eq> Eq for ~T {
#[inline(always)]
fn eq(&self, other: &~T) -> bool { *(*self) == *(*other) }
......@@ -20,7 +20,7 @@ fn eq(&self, other: &~T) -> bool { *(*self) == *(*other) }
fn ne(&self, other: &~T) -> bool { *(*self) != *(*other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Ord> Ord for ~T {
#[inline(always)]
fn lt(&self, other: &~T) -> bool { *(*self) < *(*other) }
......
......@@ -15,7 +15,7 @@
use libc::{c_void, size_t};
use sys;
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(not(test))] use cmp::{Eq, Ord};
use uint;
pub mod libc_ {
......@@ -243,7 +243,7 @@ fn offset(&self, count: uint) -> *mut T { mut_offset(*self, count) }
}
// Equality for pointers
#[cfg(notest)]
#[cfg(not(test))]
impl<T> Eq for *const T {
#[inline(always)]
fn eq(&self, other: &*const T) -> bool {
......@@ -258,7 +258,7 @@ fn ne(&self, other: &*const T) -> bool { !(*self).eq(other) }
}
// Comparison for pointers
#[cfg(notest)]
#[cfg(not(test))]
impl<T> Ord for *const T {
#[inline(always)]
fn lt(&self, other: &*const T) -> bool {
......@@ -295,7 +295,7 @@ fn gt(&self, other: &*const T) -> bool {
}
// Equality for region pointers
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:Eq> Eq for &'self T {
#[inline(always)]
fn eq(&self, other: & &'self T) -> bool {
......@@ -308,7 +308,7 @@ fn ne(&self, other: & &'self T) -> bool {
}
// Comparison for region pointers
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:Ord> Ord for &'self T {
#[inline(always)]
fn lt(&self, other: & &'self T) -> bool {
......
......@@ -32,7 +32,7 @@
use vec;
use to_str::ToStr;
#[cfg(notest)] use cmp::{Eq, Ord, Equiv, TotalEq};
#[cfg(not(test))] use cmp::{Eq, Ord, Equiv, TotalEq};
/*
Section: Creating a string
......@@ -913,7 +913,7 @@ pub fn replace(s: &str, from: &str, to: &str) -> ~str {
*/
/// Bytewise slice equality
#[cfg(notest)]
#[cfg(not(test))]
#[lang="str_eq"]
#[inline]
pub fn eq_slice(a: &str, b: &str) -> bool {
......@@ -949,7 +949,7 @@ pub fn eq_slice(a: &str, b: &str) -> bool {
}
/// Bytewise string equality
#[cfg(notest)]
#[cfg(not(test))]
#[lang="uniq_str_eq"]
#[inline]
pub fn eq(a: &~str, b: &~str) -> bool {
......@@ -977,19 +977,19 @@ fn cmp(a: &str, b: &str) -> Ordering {
a.len().cmp(&b.len())
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self> TotalOrd for &'self str {
#[inline]
fn cmp(&self, other: & &'self str) -> Ordering { cmp(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalOrd for ~str {
#[inline]
fn cmp(&self, other: &~str) -> Ordering { cmp(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalOrd for @str {
#[inline]
fn cmp(&self, other: &@str) -> Ordering { cmp(*self, *other) }
......@@ -1030,7 +1030,7 @@ fn gt(a: &str, b: &str) -> bool {
!le(a, b)
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self> Eq for &'self str {
#[inline(always)]
fn eq(&self, other: & &'self str) -> bool {
......@@ -1040,7 +1040,7 @@ fn eq(&self, other: & &'self str) -> bool {
fn ne(&self, other: & &'self str) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for ~str {
#[inline(always)]
fn eq(&self, other: &~str) -> bool {
......@@ -1050,7 +1050,7 @@ fn eq(&self, other: &~str) -> bool {
fn ne(&self, other: &~str) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Eq for @str {
#[inline(always)]
fn eq(&self, other: &@str) -> bool {
......@@ -1060,7 +1060,7 @@ fn eq(&self, other: &@str) -> bool {
fn ne(&self, other: &@str) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self> TotalEq for &'self str {
#[inline(always)]
fn equals(&self, other: & &'self str) -> bool {
......@@ -1068,7 +1068,7 @@ fn equals(&self, other: & &'self str) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalEq for ~str {
#[inline(always)]
fn equals(&self, other: &~str) -> bool {
......@@ -1076,7 +1076,7 @@ fn equals(&self, other: &~str) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl TotalEq for @str {
#[inline(always)]
fn equals(&self, other: &@str) -> bool {
......@@ -1084,7 +1084,7 @@ fn equals(&self, other: &@str) -> bool {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for ~str {
#[inline(always)]
fn lt(&self, other: &~str) -> bool { lt((*self), (*other)) }
......@@ -1096,7 +1096,7 @@ fn ge(&self, other: &~str) -> bool { ge((*self), (*other)) }
fn gt(&self, other: &~str) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self> Ord for &'self str {
#[inline(always)]
fn lt(&self, other: & &'self str) -> bool { lt((*self), (*other)) }
......@@ -1108,7 +1108,7 @@ fn ge(&self, other: & &'self str) -> bool { ge((*self), (*other)) }
fn gt(&self, other: & &'self str) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl Ord for @str {
#[inline(always)]
fn lt(&self, other: &@str) -> bool { lt((*self), (*other)) }
......@@ -1120,7 +1120,7 @@ fn ge(&self, other: &@str) -> bool { ge((*self), (*other)) }
fn gt(&self, other: &@str) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self> Equiv<~str> for &'self str {
#[inline(always)]
fn equiv(&self, other: &~str) -> bool { eq_slice(*self, *other) }
......@@ -2451,7 +2451,7 @@ fn test_from_buf_len() {
}
#[cfg(notest)]
#[cfg(not(test))]
pub mod traits {
use ops::Add;
use str::append;
......
......@@ -14,7 +14,7 @@
use kinds::Copy;
use vec;
#[cfg(notest)] use cmp::{Eq, Ord};
#[cfg(not(test))] use cmp::{Eq, Ord};
pub trait CopyableTuple<T, U> {
fn first(&self) -> T;
......@@ -122,7 +122,7 @@ fn map<C>(&self, f: &fn(a: &A, b: &B) -> C) -> ~[C] {
}
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Eq> Eq for (A,) {
#[inline(always)]
fn eq(&self, other: &(A,)) -> bool {
......@@ -138,7 +138,7 @@ fn eq(&self, other: &(A,)) -> bool {
fn ne(&self, other: &(A,)) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Ord> Ord for (A,) {
#[inline(always)]
fn lt(&self, other: &(A,)) -> bool {
......@@ -161,7 +161,7 @@ fn ge(&self, other: &(A,)) -> bool { !self.lt(other) }
fn gt(&self, other: &(A,)) -> bool { other.lt(&(*self)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Eq,B:Eq> Eq for (A, B) {
#[inline(always)]
fn eq(&self, other: &(A, B)) -> bool {
......@@ -177,7 +177,7 @@ fn eq(&self, other: &(A, B)) -> bool {
fn ne(&self, other: &(A, B)) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Ord,B:Ord> Ord for (A, B) {
#[inline(always)]
fn lt(&self, other: &(A, B)) -> bool {
......@@ -202,7 +202,7 @@ fn ge(&self, other: &(A, B)) -> bool { !(*self).lt(other) }
fn gt(&self, other: &(A, B)) -> bool { (*other).lt(&(*self)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Eq,B:Eq,C:Eq> Eq for (A, B, C) {
#[inline(always)]
fn eq(&self, other: &(A, B, C)) -> bool {
......@@ -219,7 +219,7 @@ fn eq(&self, other: &(A, B, C)) -> bool {
fn ne(&self, other: &(A, B, C)) -> bool { !(*self).eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<A:Ord,B:Ord,C:Ord> Ord for (A, B, C) {
#[inline(always)]
fn lt(&self, other: &(A, B, C)) -> bool {
......
......@@ -35,7 +35,7 @@
#[path = "unstable/extfmt.rs"]
pub mod extfmt;
#[path = "unstable/lang.rs"]
#[cfg(notest)]
#[cfg(not(test))]
pub mod lang;
mod rustrt {
......
......@@ -30,7 +30,7 @@
use unstable::intrinsics;
use vec;
#[cfg(notest)] use cmp::Equiv;
#[cfg(not(test))] use cmp::Equiv;
pub mod rustrt {
use libc;
......@@ -1656,7 +1656,7 @@ fn equals<T: TotalEq>(a: &[T], b: &[T]) -> bool {
true
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:Eq> Eq for &'self [T] {
#[inline(always)]
fn eq(&self, other: & &'self [T]) -> bool { eq(*self, *other) }
......@@ -1664,7 +1664,7 @@ fn eq(&self, other: & &'self [T]) -> bool { eq(*self, *other) }
fn ne(&self, other: & &'self [T]) -> bool { !self.eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Eq> Eq for ~[T] {
#[inline(always)]
fn eq(&self, other: &~[T]) -> bool { eq(*self, *other) }
......@@ -1672,7 +1672,7 @@ fn eq(&self, other: &~[T]) -> bool { eq(*self, *other) }
fn ne(&self, other: &~[T]) -> bool { !self.eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Eq> Eq for @[T] {
#[inline(always)]
fn eq(&self, other: &@[T]) -> bool { eq(*self, *other) }
......@@ -1680,25 +1680,25 @@ fn eq(&self, other: &@[T]) -> bool { eq(*self, *other) }
fn ne(&self, other: &@[T]) -> bool { !self.eq(other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:TotalEq> TotalEq for &'self [T] {
#[inline(always)]
fn equals(&self, other: & &'self [T]) -> bool { equals(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:TotalEq> TotalEq for ~[T] {
#[inline(always)]
fn equals(&self, other: &~[T]) -> bool { equals(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:TotalEq> TotalEq for @[T] {
#[inline(always)]
fn equals(&self, other: &@[T]) -> bool { equals(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:Eq> Equiv<~[T]> for &'self [T] {
#[inline(always)]
fn equiv(&self, other: &~[T]) -> bool { eq(*self, *other) }
......@@ -1720,19 +1720,19 @@ fn cmp<T: TotalOrd>(a: &[T], b: &[T]) -> Ordering {
a.len().cmp(&b.len())
}
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:TotalOrd> TotalOrd for &'self [T] {
#[inline(always)]
fn cmp(&self, other: & &'self [T]) -> Ordering { cmp(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T: TotalOrd> TotalOrd for ~[T] {
#[inline(always)]
fn cmp(&self, other: &~[T]) -> Ordering { cmp(*self, *other) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T: TotalOrd> TotalOrd for @[T] {
#[inline(always)]
fn cmp(&self, other: &@[T]) -> Ordering { cmp(*self, *other) }
......@@ -1757,7 +1757,7 @@ fn le<T:Ord>(a: &[T], b: &[T]) -> bool { !lt(b, a) }
fn ge<T:Ord>(a: &[T], b: &[T]) -> bool { !lt(a, b) }
fn gt<T:Ord>(a: &[T], b: &[T]) -> bool { lt(b, a) }
#[cfg(notest)]
#[cfg(not(test))]
impl<'self,T:Ord> Ord for &'self [T] {
#[inline(always)]
fn lt(&self, other: & &'self [T]) -> bool { lt((*self), (*other)) }
......@@ -1769,7 +1769,7 @@ fn ge(&self, other: & &'self [T]) -> bool { ge((*self), (*other)) }
fn gt(&self, other: & &'self [T]) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Ord> Ord for ~[T] {
#[inline(always)]
fn lt(&self, other: &~[T]) -> bool { lt((*self), (*other)) }
......@@ -1781,7 +1781,7 @@ fn ge(&self, other: &~[T]) -> bool { ge((*self), (*other)) }
fn gt(&self, other: &~[T]) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
impl<T:Ord> Ord for @[T] {
#[inline(always)]
fn lt(&self, other: &@[T]) -> bool { lt((*self), (*other)) }
......@@ -1793,7 +1793,7 @@ fn ge(&self, other: &@[T]) -> bool { ge((*self), (*other)) }
fn gt(&self, other: &@[T]) -> bool { gt((*self), (*other)) }
}
#[cfg(notest)]
#[cfg(not(test))]
pub mod traits {
use kinds::Copy;
use ops::Add;
......
......@@ -119,9 +119,8 @@ pub fn build_configuration(sess: Session, argv0: @~str, input: &input) ->
let default_cfg = default_configuration(sess, argv0, input);
let user_cfg = /*bad*/copy sess.opts.cfg;
// If the user wants a test runner, then add the test cfg
let user_cfg = append_configuration(
user_cfg,
if sess.opts.test { ~"test" } else { ~"notest" });
let user_cfg = if sess.opts.test { append_configuration(user_cfg, ~"test") }
else { user_cfg };
// If the user requested GC, then add the GC cfg
let user_cfg = append_configuration(
user_cfg,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册