-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Functions are missing from "--emit=llvm-ir" and "--emit=asm" #119850
Comments
I think this is reasonable and probably the best way to fix it. |
There are some use cases where it would be better for a crate to be able to switch back to opt-in inlining. For example, if an application is compiling crates to dylibs they may be doing so so that they can replace a single dynamic library with a bug fix, without having to ship an update to the entire app. In this case they'd like very few functions inlined. It is error-prone to add With this in mind, instead of special casing these Note that I realize that the compiler never made any guarantees about inlining, so what I'm asking for is actually an improvement over even the previous state of things, before automatic inlining was implemented. I do think automatic inlining by default was a good change. |
To replace a function you'll have to annotate it with |
Ideally we'd be able to recompile a dylib crate with the same toolchain and have the resulting shared library be a drop-in replacement (ABI-compatible) for the previous one, as long as we don't change the public API of the crate in any way, at least if we use |
…output (#6013) Resolves #5939. Rust issue about this problem: rust-lang/rust#119850 Hopefully this can be reverted again when there is a fix on the Rust side.
Ever since #116505 landed, functions can be missing from "--emit=llvm-ir" and "--emit=asm" unless they are declared with
#[inline(never)]
or#[no_mangle]
. This is quite surprising to most people that want to explore the LLVM IR / asm of a Rust function.It's unclear how to best fix this, since not producing LLVM IR or asm (but only MIR) when compiling these functions was part of the goal of #116505. Maybe these
--emit
flags should themselves cause the functions to be monomorphized so they become visible again?The text was updated successfully, but these errors were encountered: