fix compilation errors on release mode due to missing #[cfg(debug_assertions)] with parser event tracing
This commit is contained in:
parent
1543534101
commit
a30c36c92a
|
@ -228,6 +228,7 @@ impl Event {
|
||||||
fn new(kind: EventKind) -> Event {
|
fn new(kind: EventKind) -> Event {
|
||||||
Event {
|
Event {
|
||||||
kind,
|
kind,
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
from: core::panic::Location::caller(),
|
from: core::panic::Location::caller(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,6 +236,8 @@ impl Event {
|
||||||
|
|
||||||
impl fmt::Debug for Event {
|
impl fmt::Debug for Event {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
#[cfg(debug_assertions)]
|
||||||
|
{
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{:?} @ {}:{}:{}",
|
"{:?} @ {}:{}:{}",
|
||||||
|
@ -242,7 +245,15 @@ impl fmt::Debug for Event {
|
||||||
self.from.file(),
|
self.from.file(),
|
||||||
self.from.line(),
|
self.from.line(),
|
||||||
self.from.column()
|
self.from.column()
|
||||||
)
|
)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(debug_assertions))]
|
||||||
|
{
|
||||||
|
write!(f, "{:?}", self.kind,)?;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue