mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Change not(ndebug) to debug_assertions
The name of this directive changed in rust-lang/rust#22980.
This commit is contained in:
parent
83a0b78221
commit
b78b33b7f5
4 changed files with 14 additions and 14 deletions
|
@ -26,7 +26,7 @@ pub struct Scope;
|
|||
#[macro_export]
|
||||
macro_rules! layout_debug_scope(
|
||||
($($arg:tt)*) => (
|
||||
if cfg!(not(ndebug)) {
|
||||
if cfg!(debug_assertions) {
|
||||
layout_debug::Scope::new(format!($($arg)*))
|
||||
} else {
|
||||
layout_debug::Scope
|
||||
|
@ -76,7 +76,7 @@ impl Scope {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
impl Drop for Scope {
|
||||
fn drop(&mut self) {
|
||||
STATE_KEY.with(|ref r| {
|
||||
|
|
|
@ -529,7 +529,7 @@ impl ScriptTask {
|
|||
}
|
||||
|
||||
// Needed for debug assertions about whether GC is running.
|
||||
if !cfg!(ndebug) {
|
||||
if cfg!(debug_assertions) {
|
||||
unsafe {
|
||||
JS_SetGCCallback(runtime.rt(),
|
||||
Some(debug_gc_callback as unsafe extern "C" fn(*mut JSRuntime, JSGCStatus)));
|
||||
|
|
|
@ -117,17 +117,17 @@ impl Debug for WritingMode {
|
|||
/// 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 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)]
|
||||
struct DebugWritingMode;
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
#[derive(RustcEncodable, PartialEq, Eq, Clone, Copy)]
|
||||
struct DebugWritingMode {
|
||||
mode: WritingMode
|
||||
}
|
||||
|
||||
#[cfg(ndebug)]
|
||||
#[cfg(not(debug_assertions))]
|
||||
impl DebugWritingMode {
|
||||
#[inline]
|
||||
fn check(&self, _other: WritingMode) {}
|
||||
|
@ -141,7 +141,7 @@ impl DebugWritingMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
impl DebugWritingMode {
|
||||
#[inline]
|
||||
fn check(&self, other: WritingMode) {
|
||||
|
@ -160,12 +160,12 @@ impl DebugWritingMode {
|
|||
}
|
||||
|
||||
impl Debug for DebugWritingMode {
|
||||
#[cfg(ndebug)]
|
||||
#[cfg(not(debug_assertions))]
|
||||
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
||||
write!(formatter, "?")
|
||||
}
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
||||
self.mode.fmt(formatter)
|
||||
}
|
||||
|
|
|
@ -26,18 +26,18 @@ bitflags! {
|
|||
macro_rules! task_types ( ( $( $fun:ident = $flag:ident ; )* ) => (
|
||||
impl TaskState {
|
||||
$(
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
pub fn $fun(self) -> bool {
|
||||
self.contains($flag)
|
||||
}
|
||||
#[cfg(ndebug)]
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub fn $fun(self) -> bool {
|
||||
true
|
||||
}
|
||||
)*
|
||||
}
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
static TYPES: &'static [TaskState]
|
||||
= &[ $( $flag ),* ];
|
||||
));
|
||||
|
@ -48,7 +48,7 @@ task_types! {
|
|||
is_paint = PAINT;
|
||||
}
|
||||
|
||||
#[cfg(not(ndebug))]
|
||||
#[cfg(debug_assertions)]
|
||||
mod imp {
|
||||
use super::{TaskState, TYPES};
|
||||
use std::cell::RefCell;
|
||||
|
@ -96,7 +96,7 @@ mod imp {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(ndebug)]
|
||||
#[cfg(not(debug_assertions))]
|
||||
mod imp {
|
||||
use super::TaskState;
|
||||
#[inline(always)] pub fn initialize(_: TaskState) { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue