Skip to content

Add #[track_caller] to Duration Div impl #137207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/core/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ impl Div<u32> for Duration {
type Output = Duration;

#[inline]
#[track_caller]
fn div(self, rhs: u32) -> Duration {
self.checked_div(rhs).expect("divide by zero error when dividing duration by scalar")
}
Expand All @@ -1176,6 +1177,7 @@ impl Div<u32> for Duration {
#[stable(feature = "time_augmented_assignment", since = "1.9.0")]
impl DivAssign<u32> for Duration {
#[inline]
#[track_caller]
fn div_assign(&mut self, rhs: u32) {
*self = *self / rhs;
}
Expand Down
Loading