Skip to content

mark some panicking methods around Duration as track_caller - #156133

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:time-panic-track-caller
May 10, 2026
Merged

mark some panicking methods around Duration as track_caller#156133
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:time-panic-track-caller

Conversation

@RalfJung

Copy link
Copy Markdown
Member

Currently when they panic it looks like this

 0.005045 ---- instant_checked_duration_since_nopanic stdout ----
0.000039
0.000009 thread 'instant_checked_duration_since_nopanic' (2) panicked at /home/runner/work/miri-test-libstd/miri-test-libstd/rust-src-patched/library/std/src/time.rs:445:33:
0.000007 overflow when subtracting duration from instant
0.000006 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0.000007 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

That's pretty useless.

Also fix the panic message while we are at it.

@rustbotrustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 4, 2026
@rustbot

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, nia-e

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup

@rust-bors

rust-borsBot commented May 9, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 09dc7fc has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-borsrust-borsBot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 9, 2026
…r=Mark-Simulacrum
mark some panicking methods around Duration as track_caller
Currently when they panic it looks like this
```
0.005045 ---- instant_checked_duration_since_nopanic stdout ----
0.000039
0.000009 thread 'instant_checked_duration_since_nopanic' (2) panicked at /home/runner/work/miri-test-libstd/miri-test-libstd/rust-src-patched/library/std/src/time.rs:445:33:
0.000007 overflow when subtracting duration from instant
0.000006 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0.000007 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
```
That's pretty useless.
Also fix the panic message while we are at it.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request May 9, 2026
…r=Mark-Simulacrum
mark some panicking methods around Duration as track_caller
Currently when they panic it looks like this
```
0.005045 ---- instant_checked_duration_since_nopanic stdout ----
0.000039
0.000009 thread 'instant_checked_duration_since_nopanic' (2) panicked at /home/runner/work/miri-test-libstd/miri-test-libstd/rust-src-patched/library/std/src/time.rs:445:33:
0.000007 overflow when subtracting duration from instant
0.000006 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0.000007 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
```
That's pretty useless.
Also fix the panic message while we are at it.
rust-borsBot pushed a commit that referenced this pull request May 9, 2026
…uwer
Rollup of 10 pull requests
Successful merges:
- #148214 (Consider `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` to be equivalent to `T` for must use lint)
- #149362 (Add Command::get_resolved_envs)
- #155705 (Add `str::word_to_titlecase()` to `alloc`)
- #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.)
- #156006 (Update a bunch of bootstrap dependencies to remove windows-target)
- #155188 (Add regression test for issue 144329)
- #155515 (error on empty `export_name`)
- #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
- #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation))
- #156133 (mark some panicking methods around Duration as track_caller)
rust-borsBot pushed a commit that referenced this pull request May 10, 2026
Rollup of 11 pull requests
Successful merges:
- #149362 (Add Command::get_resolved_envs)
- #155705 (Add `str::word_to_titlecase()` to `alloc`)
- #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.)
- #156006 (Update a bunch of bootstrap dependencies to remove windows-target)
- #156169 (Change `SwitchInt` handling in dataflow analysis.)
- #155188 (Add regression test for issue 144329)
- #155515 (error on empty `export_name`)
- #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
- #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation))
- #156133 (mark some panicking methods around Duration as track_caller)
- #156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
rust-borsBot pushed a commit that referenced this pull request May 10, 2026
Rollup of 11 pull requests
Successful merges:
- #149362 (Add Command::get_resolved_envs)
- #155705 (Add `str::word_to_titlecase()` to `alloc`)
- #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.)
- #156006 (Update a bunch of bootstrap dependencies to remove windows-target)
- #156169 (Change `SwitchInt` handling in dataflow analysis.)
- #155188 (Add regression test for issue 144329)
- #155515 (error on empty `export_name`)
- #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
- #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation))
- #156133 (mark some panicking methods around Duration as track_caller)
- #156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
rust-borsBot pushed a commit that referenced this pull request May 10, 2026
Rollup of 11 pull requests
Successful merges:
- #149362 (Add Command::get_resolved_envs)
- #155705 (Add `str::word_to_titlecase()` to `alloc`)
- #155970 (Add mention of sendfile(2) and splice(2) to fs::copy() documentation.)
- #156006 (Update a bunch of bootstrap dependencies to remove windows-target)
- #156169 (Change `SwitchInt` handling in dataflow analysis.)
- #155188 (Add regression test for issue 144329)
- #155515 (error on empty `export_name`)
- #155817 (validate `#[link_name = "..."]` & `#[link(name = "...")]` parameters)
- #156107 (remove turbofish notation + use None / Some instead of Option:: (in match documentation))
- #156133 (mark some panicking methods around Duration as track_caller)
- #156363 (`rustc_attr_parsing`: add `AcceptContext::expect_string_literal`)
@rust-bors
rust-borsBot merged commit 3401857 into rust-lang:mainMay 10, 2026
11 checks passed
@rustbotrustbot added this to the 1.97.0 milestone May 10, 2026
rust-timer added a commit that referenced this pull request May 10, 2026
Rollup merge of #156133 - RalfJung:time-panic-track-caller, r=Mark-Simulacrum
mark some panicking methods around Duration as track_caller
Currently when they panic it looks like this
```
0.005045 ---- instant_checked_duration_since_nopanic stdout ----
0.000039
0.000009 thread 'instant_checked_duration_since_nopanic' (2) panicked at /home/runner/work/miri-test-libstd/miri-test-libstd/rust-src-patched/library/std/src/time.rs:445:33:
0.000007 overflow when subtracting duration from instant
0.000006 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0.000007 note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
```
That's pretty useless.
Also fix the panic message while we are at it.
@RalfJung
RalfJung deleted the time-panic-track-caller branch May 11, 2026 11:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@RalfJung@rustbot@Mark-Simulacrum