How can I force it to be inlined in the main routine? Also, it would be great if someone could explain at a lower level why does it behave like this? Thanks in advance for your help
The #[inline] attribute is a hint to the compiler to include metadata about a function so it can be inlined when compiling later crates. It doesn't force every call to modify() to be inlined, for that you can use #[inline(always)].
Keep in mind that overriding the optimiser's decision to inline with #[inline(always)] is often warned against because it can sometimes actually decrease performance.
I'm guessing you're using nightly? If so, I'd check the issue tracker and create a ticket if there isn't one already.
I'd say bitcode-in-rlib is referring to that #[inline] "metadata" I was talking about. If we wanted to let users inline foo() in crate bar, we'd compile foo's body to bitcode and embed it in libbar.rlib so crates depending on bar can use it.