X-Git-Url: https://git.ralfj.de/web.git/blobdiff_plain/6e3a177d13831aa8425e8ac597ab7ae2425b921f..cc66a8147d34e9ea3b7797e675aa19b94a6e23d2:/ralf/_posts/2019-11-25-how-to-panic-in-rust.md diff --git a/ralf/_posts/2019-11-25-how-to-panic-in-rust.md b/ralf/_posts/2019-11-25-how-to-panic-in-rust.md index 66ca0ab..2c03da8 100644 --- a/ralf/_posts/2019-11-25-how-to-panic-in-rust.md +++ b/ralf/_posts/2019-11-25-how-to-panic-in-rust.md @@ -1,9 +1,10 @@ --- title: "How to Panic in Rust" categories: rust +forum: https://internals.rust-lang.org/t/how-to-panic-in-rust/11368 --- -What exactly happens when you write `panic!()`? +What exactly happens when you `panic!()`? I recently spent a lot of time looking at the parts of the standard library concerned with this, and it turns out the answer is quite complicated! I have not been able to find docs explaining the high-level picture of panicking in Rust, so this feels worth writing down. @@ -151,7 +152,7 @@ However, even with that future extension, I think we have the invariant that whe I wonder if there is any case where *both* fields will be useful -- and if not, couldn't we encode that by making them two variants of an `enum`? There are probably good reasons against that proposal and for the current design; it would be great to get them documented somewhere. :) -There is a lot more to say, but at this point, I invite you to follow the links to the source code that I included above and read the local comments. -With the high-level structure in mind, those comments should be able to fill out any missing details. -If people think this information would be worth putting somewhere more permanently, I'd be happy to work this blog post into some form of docs -- I am not sure what would be a good place for those, though. +There is a lot more to say, but at this point, I invite you to follow the links to the source code that I included above. +With the high-level structure in mind, you should be able to follow that code. +If people think this overview would be worth putting somewhere more permanently, I'd be happy to work this blog post into some form of docs -- I am not sure what would be a good place for those, though. And if you find any mistakes in what I wrote, please let me know!