Skip to content

Commit 042473f

Browse files
committed
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.
1 parent 49f54b8 commit 042473f

File tree

1 file changed

+4
-4
lines changed
  • src/tools/build_helper/src/drop_bomb

1 file changed

+4
-4
lines changed

src/tools/build_helper/src/drop_bomb/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod tests;
1515
pub struct DropBomb {
1616
command: OsString,
1717
defused: bool,
18-
armed_line: u32,
18+
armed_location: panic::Location<'static>,
1919
}
2020

2121
impl DropBomb {
@@ -27,7 +27,7 @@ impl DropBomb {
2727
DropBomb {
2828
command: command.as_ref().into(),
2929
defused: false,
30-
armed_line: panic::Location::caller().line(),
30+
armed_location: *panic::Location::caller(),
3131
}
3232
}
3333

@@ -41,8 +41,8 @@ impl Drop for DropBomb {
4141
fn drop(&mut self) {
4242
if !self.defused && !std::thread::panicking() {
4343
panic!(
44-
"command constructed but not executed at line {}: `{}`",
45-
self.armed_line,
44+
"command constructed but not executed at {}: `{}`",
45+
self.armed_location,
4646
self.command.to_string_lossy()
4747
)
4848
}

0 commit comments

Comments
 (0)