diff options
| author | Jakub Beránek <jakub.beranek@vsb.cz> | 2024-07-04 15:56:16 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2024-07-12 20:14:38 +0200 |
| commit | 042473fd13eaa51eb795dfb643b7660fb8d653a7 (patch) | |
| tree | 914c833541ccac963a8c932a18a915c53bacb260 | |
| parent | 49f54b8ee8c8ac04e53d30832d52b0b06e43540b (diff) | |
| download | rust-042473fd13eaa51eb795dfb643b7660fb8d653a7.tar.gz rust-042473fd13eaa51eb795dfb643b7660fb8d653a7.zip | |
Store full arm location in `DropBomb`
Before, only the line was stored. This was enough for run-make tests, since these mostly only contain a single `rmake.rs` file, but not for bootstrap.
| -rw-r--r-- | src/tools/build_helper/src/drop_bomb/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/build_helper/src/drop_bomb/mod.rs b/src/tools/build_helper/src/drop_bomb/mod.rs index ffb86d1c9ee..854113a5181 100644 --- a/src/tools/build_helper/src/drop_bomb/mod.rs +++ b/src/tools/build_helper/src/drop_bomb/mod.rs @@ -15,7 +15,7 @@ mod tests; pub struct DropBomb { command: OsString, defused: bool, - armed_line: u32, + armed_location: panic::Location<'static>, } impl DropBomb { @@ -27,7 +27,7 @@ impl DropBomb { DropBomb { command: command.as_ref().into(), defused: false, - armed_line: panic::Location::caller().line(), + armed_location: *panic::Location::caller(), } } @@ -41,8 +41,8 @@ impl Drop for DropBomb { fn drop(&mut self) { if !self.defused && !std::thread::panicking() { panic!( - "command constructed but not executed at line {}: `{}`", - self.armed_line, + "command constructed but not executed at {}: `{}`", + self.armed_location, self.command.to_string_lossy() ) } |
