Skip to content

Remove #[cfg(notest)] and use #[cfg(not(test))] #6327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/libcore/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) }
Expand All @@ -87,13 +87,13 @@ impl Ord for bool {
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) }
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

//! Utilities for manipulating the char type

#[cfg(notest)]
#[cfg(not(test))]
use cmp::Ord;
use option::{None, Option, Some};
use str;
use u32;
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
Expand Down Expand Up @@ -244,15 +244,15 @@ 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) }
#[inline(always)]
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 }
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ use ptr::mut_null;
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
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/managed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -49,23 +49,23 @@ 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) }
#[inline(always)]
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) }
#[inline(always)]
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) }
Expand All @@ -77,7 +77,7 @@ impl<T:Ord> Ord for @T {
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) }
Expand Down
10 changes: 5 additions & 5 deletions src/libcore/nil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ Functions for the unit type.

*/

#[cfg(notest)]
#[cfg(not(test))]
use prelude::*;

#[cfg(notest)]
#[cfg(not(test))]
impl Eq for () {
#[inline(always)]
fn eq(&self, _other: &()) -> bool { true }
#[inline(always)]
fn ne(&self, _other: &()) -> bool { false }
}

#[cfg(notest)]
#[cfg(not(test))]
impl Ord for () {
#[inline(always)]
fn lt(&self, _other: &()) -> bool { false }
Expand All @@ -37,13 +37,13 @@ impl Ord for () {
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 }
Expand Down
18 changes: 9 additions & 9 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ 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) }
#[inline(always)]
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 }
Expand All @@ -222,7 +222,7 @@ impl ApproxEq<f32> for f32 {
}
}

#[cfg(notest)]
#[cfg(not(test))]
impl Ord for f32 {
#[inline(always)]
fn lt(&self, other: &f32) -> bool { (*self) < (*other) }
Expand Down Expand Up @@ -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 }
Expand Down
18 changes: 9 additions & 9 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,15 @@ 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) }
#[inline(always)]
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 }
Expand All @@ -245,7 +245,7 @@ impl ApproxEq<f64> for f64 {
}
}

#[cfg(notest)]
#[cfg(not(test))]
impl Ord for f64 {
#[inline(always)]
fn lt(&self, other: &f64) -> bool { (*self) < (*other) }
Expand Down Expand Up @@ -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 }
}
Expand Down
Loading