add track_caller for arith ops

This commit is contained in:
bohan
2023-11-24 00:54:06 +08:00
parent 91f7f266ce
commit fc87d6e23d
16 changed files with 95 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ macro_rules! forward_ref_binop {
type Output = <$t as $imp<$u>>::Output;
#[inline]
#[track_caller]
fn $method(self, other: $u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, other)
}
@@ -41,6 +42,7 @@ macro_rules! forward_ref_binop {
type Output = <$t as $imp<$u>>::Output;
#[inline]
#[track_caller]
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(self, *other)
}
@@ -51,6 +53,7 @@ macro_rules! forward_ref_binop {
type Output = <$t as $imp<$u>>::Output;
#[inline]
#[track_caller]
fn $method(self, other: &$u) -> <$t as $imp<$u>>::Output {
$imp::$method(*self, *other)
}
@@ -69,6 +72,7 @@ macro_rules! forward_ref_op_assign {
#[$attr]
impl $imp<&$u> for $t {
#[inline]
#[track_caller]
fn $method(&mut self, other: &$u) {
$imp::$method(self, *other);
}