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.
This commit is contained in:
parent
49f54b8ee8
commit
042473fd13
@ -15,7 +15,7 @@ mod tests;
|
|||||||
pub struct DropBomb {
|
pub struct DropBomb {
|
||||||
command: OsString,
|
command: OsString,
|
||||||
defused: bool,
|
defused: bool,
|
||||||
armed_line: u32,
|
armed_location: panic::Location<'static>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl DropBomb {
|
impl DropBomb {
|
||||||
@ -27,7 +27,7 @@ impl DropBomb {
|
|||||||
DropBomb {
|
DropBomb {
|
||||||
command: command.as_ref().into(),
|
command: command.as_ref().into(),
|
||||||
defused: false,
|
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) {
|
fn drop(&mut self) {
|
||||||
if !self.defused && !std::thread::panicking() {
|
if !self.defused && !std::thread::panicking() {
|
||||||
panic!(
|
panic!(
|
||||||
"command constructed but not executed at line {}: `{}`",
|
"command constructed but not executed at {}: `{}`",
|
||||||
self.armed_line,
|
self.armed_location,
|
||||||
self.command.to_string_lossy()
|
self.command.to_string_lossy()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user