rustc-dev-guide icon indicating copy to clipboard operation
rustc-dev-guide copied to clipboard

Add "landing pads" to the glossary

Open mark-i-m opened this issue 5 years ago • 8 comments

mark-i-m avatar May 19 '20 19:05 mark-i-m

Is a "landing pad" a link to the section that discusses the term?

camelid avatar Jan 04 '21 00:01 camelid

I was looking at this the other day, my interpretation of the issue is that it is just adding to the glossary a general definition of landing pad and contextualize it somewhat for the rustc.

I was thinking of something like "A section of user code intended to catch, or otherwise clean up after, an exception."

igaray avatar Jan 04 '21 00:01 igaray

https://llvm.org/docs/ExceptionHandling.html#overview

jyn514 avatar Jan 04 '21 00:01 jyn514

Here's my attempt...

A section of code that gets executed during unwinding to do cleanup operations (like invoking destructors and freeing memory).

tshepang avatar Jan 30 '21 16:01 tshepang

It's also tempting to use the term exception handler, but I don't know how to explain that since Rust doesn't have exceptions.

tshepang avatar Jan 30 '21 17:01 tshepang

"Panic handler" maybe?

LeSeulArtichaut avatar Jan 30 '21 19:01 LeSeulArtichaut

"Panic handler" maybe?

That's ambiguous with https://doc.rust-lang.org/nomicon/panic-handler.html IMO. This is more similar to a catch block, there are landing pads at the end of every scope.

jyn514 avatar Jan 30 '21 20:01 jyn514

Since landing pads don't really have a analogy to any language feature but are instead used in the implementation of stack unwinding (which are in turn used by exceptions in C++ and panics in Rust), I don't think we should use "panic handler" or "exception handler". @tshepang's attempt is a good start.

rylev avatar Feb 01 '21 09:02 rylev