-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
link-dead-code does not include symbols for unused inlined functions #45174
Comments
This is currently expected behavior as the compiler never generates any code for |
But this seems contrary to the intent of the link-dead-code (improve coverage accuracy, see #31368) |
Yes, I can see how that would make sense when you are interested in code coverage. @rust-lang/dev-tools @rust-lang/compiler Do we have compiler options that are targeted specifically towards code coverage? Or should we just produce code for unused inline functions if |
@michaelwoerister AFAIK we don't have many other options for code coverage, we're definitely long overdue for a flag for "I'd like to generate code coverage", but there's lots of hairy problems about implementing such a flag (e.g. inline functions today, generics, etc) |
If we don't want to extend the meaning of I don't feel like the smaller emit-unused-inline-functions-in-the-binary feature needs to be blocked on a more general code coverage mode. |
Yeah, adding a targeted flag instead of changing the meaning of |
Triage: I'm not aware of any changes or additions here. |
As of rustc 1.72.0, the original repro, verbatim, doesn't reproduce the issue. These cases still do:
While these cases do not:
However, if the function is instead marked For the It would be tempting to have |
Consider a file
x.rs
:The symbol
gggg
is not included in the compiled binary (tested withrustc -C link-dead-code x.rs && nm x | grep gggg
). If the inline attribute is removed, the symbol is included.The text was updated successfully, but these errors were encountered: