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 {
|
||||
Event {
|
||||
kind,
|
||||
#[cfg(debug_assertions)]
|
||||
from: core::panic::Location::caller(),
|
||||
}
|
||||
}
|
||||
|
@ -235,14 +236,24 @@ impl Event {
|
|||
|
||||
impl fmt::Debug for Event {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{:?} @ {}:{}:{}",
|
||||
self.kind,
|
||||
self.from.file(),
|
||||
self.from.line(),
|
||||
self.from.column()
|
||||
)
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
write!(
|
||||
f,
|
||||
"{:?} @ {}:{}:{}",
|
||||
self.kind,
|
||||
self.from.file(),
|
||||
self.from.line(),
|
||||
self.from.column()
|
||||
)?;
|
||||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
{
|
||||
write!(f, "{:?}", self.kind,)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue