In the case, I have multiples dependencies (A, B, C), each one with the dependency of a crate "lib" with distinct versions (v1, v2, v3).
My crate -> dependency A -> lib-v1 -> dependency B -> lib-v2 -> dependency C -> lib-v3
From what I understand, the compiler will compile each dependency using its own lib version. So the final binary will have code of all 3 libraries. In the case of all used methods are identical from in all versions. Is the compiler smarty enough to merge the identical code? Would the produced binary be the same size as if all dependencies use the same library version?
I have no specific use case, I am just curious.