-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
#inline(never) is not respected #73739
Comments
Also, attribute is respected for public functions: godbolt.org |
I suspect this is a LLVM bug. |
Indeed. I've filed https://bugs.llvm.org/show_bug.cgi?id=46463. |
@rustbot modify labels: S-blocked A-codegen A-LLVM Not sure about the codegen one. |
I don't think this is an LLVM bug. The |
Furthermore any form of the inline attribute it is just a "hint" and is not required to be honored by the compiler. EDIT: though I concur with @hanna-kruppe's evaluation and believe that to be the explanation as to why, regardless of what the linked LLVM issue says. |
@hanna-kruppe is correct, this is not a bug on the LLVM side. There was some discussion that this semantic could be covered by a new |
As mentioned, this is Technically Not A Bug, and no clear motivation for guaranteeing this has been given. |
I have a case where the behavior of this attribute would be of crucial importance had it been what it claims it is. In short, I want to ease the pressure of monomorphisation an do a single implementation M which should not be exposed and then make some impls call that implementation. As you may imagine, if compiler would inline every single call to M that would defeat the purpose of the this technique. |
@lovely-error You may open a new issue explaining your use-case if you like. But if it's just for optimization purposes, the problem is not that |
I tried this code:
it compiles to:
which has
demo
inlined intomain
This worked properly in Rust 1.11 but broke in Rust 1.12 and remains broken.
The text was updated successfully, but these errors were encountered: