Change not(ndebug) to debug_assertions

The name of this directive changed in rust-lang/rust#22980.
This commit is contained in:
Matt Brubeck 2015-06-01 13:48:38 -07:00
parent 83a0b78221
commit b78b33b7f5
4 changed files with 14 additions and 14 deletions

View file

@ -26,7 +26,7 @@ pub struct Scope;
#[macro_export] #[macro_export]
macro_rules! layout_debug_scope( macro_rules! layout_debug_scope(
($($arg:tt)*) => ( ($($arg:tt)*) => (
if cfg!(not(ndebug)) { if cfg!(debug_assertions) {
layout_debug::Scope::new(format!($($arg)*)) layout_debug::Scope::new(format!($($arg)*))
} else { } else {
layout_debug::Scope layout_debug::Scope
@ -76,7 +76,7 @@ impl Scope {
} }
} }
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
impl Drop for Scope { impl Drop for Scope {
fn drop(&mut self) { fn drop(&mut self) {
STATE_KEY.with(|ref r| { STATE_KEY.with(|ref r| {

View file

@ -529,7 +529,7 @@ impl ScriptTask {
} }
// Needed for debug assertions about whether GC is running. // Needed for debug assertions about whether GC is running.
if !cfg!(ndebug) { if cfg!(debug_assertions) {
unsafe { unsafe {
JS_SetGCCallback(runtime.rt(), JS_SetGCCallback(runtime.rt(),
Some(debug_gc_callback as unsafe extern "C" fn(*mut JSRuntime, JSGCStatus))); Some(debug_gc_callback as unsafe extern "C" fn(*mut JSRuntime, JSGCStatus)));

View file

@ -117,17 +117,17 @@ impl Debug for WritingMode {
/// In debug builds only, logical geometry objects store their writing mode /// In debug builds only, logical geometry objects store their writing mode
/// (in addition to taking it as a parameter to methods) and check it. /// (in addition to taking it as a parameter to methods) and check it.
/// In non-debug builds, make this storage zero-size and the checks no-ops. /// In non-debug builds, make this storage zero-size and the checks no-ops.
#[cfg(ndebug)] #[cfg(not(debug_assertions))]
#[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)] #[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)]
struct DebugWritingMode; struct DebugWritingMode;
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
#[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)] #[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)]
struct DebugWritingMode { struct DebugWritingMode {
mode: WritingMode mode: WritingMode
} }
#[cfg(ndebug)] #[cfg(not(debug_assertions))]
impl DebugWritingMode { impl DebugWritingMode {
#[inline] #[inline]
fn check(&self, _other: WritingMode) {} fn check(&self, _other: WritingMode) {}
@ -141,7 +141,7 @@ impl DebugWritingMode {
} }
} }
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
impl DebugWritingMode { impl DebugWritingMode {
#[inline] #[inline]
fn check(&self, other: WritingMode) { fn check(&self, other: WritingMode) {
@ -160,12 +160,12 @@ impl DebugWritingMode {
} }
impl Debug for DebugWritingMode { impl Debug for DebugWritingMode {
#[cfg(ndebug)] #[cfg(not(debug_assertions))]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> { fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter, "?") write!(formatter, "?")
} }
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> { fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
self.mode.fmt(formatter) self.mode.fmt(formatter)
} }

View file

@ -26,18 +26,18 @@ bitflags! {
macro_rules! task_types ( ( $( $fun:ident = $flag:ident ; )* ) => ( macro_rules! task_types ( ( $( $fun:ident = $flag:ident ; )* ) => (
impl TaskState { impl TaskState {
$( $(
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
pub fn $fun(self) -> bool { pub fn $fun(self) -> bool {
self.contains($flag) self.contains($flag)
} }
#[cfg(ndebug)] #[cfg(not(debug_assertions))]
pub fn $fun(self) -> bool { pub fn $fun(self) -> bool {
true true
} }
)* )*
} }
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
static TYPES: &'static [TaskState] static TYPES: &'static [TaskState]
= &[ $( $flag ),* ]; = &[ $( $flag ),* ];
)); ));
@ -48,7 +48,7 @@ task_types! {
is_paint = PAINT; is_paint = PAINT;
} }
#[cfg(not(ndebug))] #[cfg(debug_assertions)]
mod imp { mod imp {
use super::{TaskState, TYPES}; use super::{TaskState, TYPES};
use std::cell::RefCell; use std::cell::RefCell;
@ -96,7 +96,7 @@ mod imp {
} }
} }
#[cfg(ndebug)] #[cfg(not(debug_assertions))]
mod imp { mod imp {
use super::TaskState; use super::TaskState;
#[inline(always)] pub fn initialize(_: TaskState) { } #[inline(always)] pub fn initialize(_: TaskState) { }