Hacker News new | ask | show | jobs
by dathinab 809 days ago
it's not trivial to do if you have multiple build targets and features

i.e. you would need to vendor one version for each features x target tripple combination combined with cfg expansion and (proc) macro expansion inlining and then a static reachability analysis to prune all unused code (and dependencies). That would likely not be good enough so you probably need to have some runtime code coverage analysis to find "likely dead code" (but not statically provable dead code) and then manual choices to keep/remove combined with some bisecting/testing to make sure the choices are sane.

Afik such tool doesn't exist.

And it's non trivial.

But it's also very viable to create it.