diff --git a/library/core/src/ops/arith.rs b/library/core/src/ops/arith.rs index 6c6479c99845..aec52424af3c 100644 --- a/library/core/src/ops/arith.rs +++ b/library/core/src/ops/arith.rs @@ -716,6 +716,7 @@ impl const Neg for $t { type Output = $t; #[inline] + #[track_caller] #[rustc_inherit_overflow_checks] fn neg(self) -> $t { -self } } diff --git a/library/core/src/ops/bit.rs b/library/core/src/ops/bit.rs index 0cd61b073738..e347a20d2d86 100644 --- a/library/core/src/ops/bit.rs +++ b/library/core/src/ops/bit.rs @@ -484,6 +484,7 @@ impl const Shl<$f> for $t { type Output = $t; #[inline] + #[track_caller] #[rustc_inherit_overflow_checks] fn shl(self, other: $f) -> $t { self << other @@ -606,6 +607,7 @@ impl const Shr<$f> for $t { type Output = $t; #[inline] + #[track_caller] #[rustc_inherit_overflow_checks] fn shr(self, other: $f) -> $t { self >> other @@ -958,6 +960,7 @@ macro_rules! shl_assign_impl { #[rustc_const_unstable(feature = "const_ops", issue = "143802")] impl const ShlAssign<$f> for $t { #[inline] + #[track_caller] #[rustc_inherit_overflow_checks] fn shl_assign(&mut self, other: $f) { *self <<= other @@ -1044,6 +1047,7 @@ macro_rules! shr_assign_impl { #[rustc_const_unstable(feature = "const_ops", issue = "143802")] impl const ShrAssign<$f> for $t { #[inline] + #[track_caller] #[rustc_inherit_overflow_checks] fn shr_assign(&mut self, other: $f) { *self >>= other