Mark debug functions cold.
This commit is contained in:
@@ -42,6 +42,8 @@ impl Default for AST {
|
||||
}
|
||||
|
||||
impl fmt::Debug for AST {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let mut fp = f.debug_struct("AST");
|
||||
|
||||
|
@@ -117,6 +117,8 @@ pub struct FnCallHashes {
|
||||
}
|
||||
|
||||
impl fmt::Debug for FnCallHashes {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
if self.script != 0 {
|
||||
@@ -199,6 +201,8 @@ pub struct FnCallExpr {
|
||||
}
|
||||
|
||||
impl fmt::Debug for FnCallExpr {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let mut ff = f.debug_struct("FnCallExpr");
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
@@ -294,7 +298,8 @@ impl<F: Float> DerefMut for FloatWrapper<F> {
|
||||
|
||||
#[cfg(not(feature = "no_float"))]
|
||||
impl<F: Float + fmt::Debug> fmt::Debug for FloatWrapper<F> {
|
||||
#[inline(always)]
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
fmt::Debug::fmt(&self.0, f)
|
||||
}
|
||||
@@ -448,6 +453,8 @@ impl Default for Expr {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Expr {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let mut display_pos = format!(" @ {:?}", self.start_position());
|
||||
|
||||
|
@@ -20,6 +20,8 @@ pub struct Ident {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Ident {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:?}", self.name)?;
|
||||
self.pos.debug_print(f)
|
||||
|
@@ -29,6 +29,8 @@ pub struct Namespace {
|
||||
}
|
||||
|
||||
impl fmt::Debug for Namespace {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if self.is_empty() {
|
||||
return f.write_str("NONE");
|
||||
|
@@ -106,6 +106,8 @@ impl OpAssignment {
|
||||
}
|
||||
|
||||
impl fmt::Debug for OpAssignment {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if self.is_op_assignment() {
|
||||
f.debug_struct("OpAssignment")
|
||||
@@ -178,7 +180,8 @@ pub enum RangeCase {
|
||||
}
|
||||
|
||||
impl fmt::Debug for RangeCase {
|
||||
#[inline]
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::ExclusiveInt(r, n) => write!(f, "{}..{} => {}", r.start, r.end, n),
|
||||
@@ -454,6 +457,8 @@ impl AsMut<[Stmt]> for StmtBlock {
|
||||
}
|
||||
|
||||
impl fmt::Debug for StmtBlock {
|
||||
#[cold]
|
||||
#[inline(never)]
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str("Block")?;
|
||||
fmt::Debug::fmt(&self.block, f)?;
|
||||
|
Reference in New Issue
Block a user