That bookkeeping is a drop in the bucket compared to all the bookkeeping rustc does. In fact, it probably already exists in some form.
When you're compiling a library, anything that's exported is a possible entrypoint for the purpose of dead code elimination. When compiling a binary, the only entrypoint is the `main` function. Apart from that, the dead code elimination algorithm is basically the same.
When you're compiling a library, anything that's exported is a possible entrypoint for the purpose of dead code elimination. When compiling a binary, the only entrypoint is the `main` function. Apart from that, the dead code elimination algorithm is basically the same.