Question about crates compilation


#1

I am considering creating some sort of crate wrapping other crates and reexporting what they provide under its own namespace and I am not sure how would that work from compiler/linker point of view.

So for example there are creates A, B and C, and I want to create D that depends on all of them and
reexports under D::utils::A, D::utils::B and D::utils::C, and have an app that uses D but only some functions from D::utils::A.
Now:

  1. Would that mean that rustc has to compile D as a whole? (but only for the first time?)
  2. Would rustc/linker be clever enough to include only the parts of D::utils::A that were actually needed?
  3. Would that unnecessarily inflate compile times or binary size for any reason?