Closed
Description
I tried this code:
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {
panic!("drop");
}
}
fn main() {
let f = Foo;
panic!("main");
}
9 | / fn main() {
10 | | let f = Foo;
11 | | panic!("main");
12 | | }
| |_^ panic in a function that cannot unwind
Clearly the function panics so the error message doesn't make much sense. I believe it's saying that while panicking, the function is placed into a context in which nested panics are disallowed. Perhaps the message could include a hint that says something like Possibly caused by nested panics from a drop function
.