I compile a crate A that depends of another crate B that contains very small functions ( 2 or 3 lines ).
When I compile the crate A, all functions are called callq A...fct... but not inline. I need to #[inline] all functions in B to allow inlining.
B contains a lot of small functions and I don't want to #[inline] all of them.
I generate asm with this cargo rustc --release -- -C lto --emit asm
To enforce cross-crate inlining you have to use #[inline]
There is nothing wrong with it, because it is still up to compiler to decide whether to inline or not.
In case of lto it should inline even without #[inline]
Without #[inline] I have no cross-crate inlining even with lto.
Well this is surprising...
I pretty sure that lto was supposed to enable cross-crate inlining too.
Maybe the behavior was changed, in which case #[inline] across your public API makes sense when you see it fitting