Skip to content

Commit b78b33b

Browse files
committed
Change not(ndebug) to debug_assertions
The name of this directive changed in rust-lang/rust#22980.
1 parent 83a0b78 commit b78b33b

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

components/layout/layout_debug.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct Scope;
2626
#[macro_export]
2727
macro_rules! layout_debug_scope(
2828
($($arg:tt)*) => (
29-
if cfg!(not(ndebug)) {
29+
if cfg!(debug_assertions) {
3030
layout_debug::Scope::new(format!($($arg)*))
3131
} else {
3232
layout_debug::Scope
@@ -76,7 +76,7 @@ impl Scope {
7676
}
7777
}
7878

79-
#[cfg(not(ndebug))]
79+
#[cfg(debug_assertions)]
8080
impl Drop for Scope {
8181
fn drop(&mut self) {
8282
STATE_KEY.with(|ref r| {

components/script/script_task.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl ScriptTask {
529529
}
530530

531531
// Needed for debug assertions about whether GC is running.
532-
if !cfg!(ndebug) {
532+
if cfg!(debug_assertions) {
533533
unsafe {
534534
JS_SetGCCallback(runtime.rt(),
535535
Some(debug_gc_callback as unsafe extern "C" fn(*mut JSRuntime, JSGCStatus)));

components/util/logical_geometry.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,17 @@ impl Debug for WritingMode {
117117
/// In debug builds only, logical geometry objects store their writing mode
118118
/// (in addition to taking it as a parameter to methods) and check it.
119119
/// In non-debug builds, make this storage zero-size and the checks no-ops.
120-
#[cfg(ndebug)]
120+
#[cfg(not(debug_assertions))]
121121
#[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)]
122122
struct DebugWritingMode;
123123

124-
#[cfg(not(ndebug))]
124+
#[cfg(debug_assertions)]
125125
#[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)]
126126
struct DebugWritingMode {
127127
mode: WritingMode
128128
}
129129

130-
#[cfg(ndebug)]
130+
#[cfg(not(debug_assertions))]
131131
impl DebugWritingMode {
132132
#[inline]
133133
fn check(&self, _other: WritingMode) {}
@@ -141,7 +141,7 @@ impl DebugWritingMode {
141141
}
142142
}
143143

144-
#[cfg(not(ndebug))]
144+
#[cfg(debug_assertions)]
145145
impl DebugWritingMode {
146146
#[inline]
147147
fn check(&self, other: WritingMode) {
@@ -160,12 +160,12 @@ impl DebugWritingMode {
160160
}
161161

162162
impl Debug for DebugWritingMode {
163-
#[cfg(ndebug)]
163+
#[cfg(not(debug_assertions))]
164164
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
165165
write!(formatter, "?")
166166
}
167167

168-
#[cfg(not(ndebug))]
168+
#[cfg(debug_assertions)]
169169
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
170170
self.mode.fmt(formatter)
171171
}

components/util/task_state.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ bitflags! {
2626
macro_rules! task_types ( ( $( $fun:ident = $flag:ident ; )* ) => (
2727
impl TaskState {
2828
$(
29-
#[cfg(not(ndebug))]
29+
#[cfg(debug_assertions)]
3030
pub fn $fun(self) -> bool {
3131
self.contains($flag)
3232
}
33-
#[cfg(ndebug)]
33+
#[cfg(not(debug_assertions))]
3434
pub fn $fun(self) -> bool {
3535
true
3636
}
3737
)*
3838
}
3939

40-
#[cfg(not(ndebug))]
40+
#[cfg(debug_assertions)]
4141
static TYPES: &'static [TaskState]
4242
= &[ $( $flag ),* ];
4343
));
@@ -48,7 +48,7 @@ task_types! {
4848
is_paint = PAINT;
4949
}
5050

51-
#[cfg(not(ndebug))]
51+
#[cfg(debug_assertions)]
5252
mod imp {
5353
use super::{TaskState, TYPES};
5454
use std::cell::RefCell;
@@ -96,7 +96,7 @@ mod imp {
9696
}
9797
}
9898

99-
#[cfg(ndebug)]
99+
#[cfg(not(debug_assertions))]
100100
mod imp {
101101
use super::TaskState;
102102
#[inline(always)] pub fn initialize(_: TaskState) { }

0 commit comments

Comments
 (0)