Code generation for generics


In C++, specialized code for generics can be generated by the compiler as it has access to the source code. How does Rust compiler generate specialized code, when the function/struct being generalized is part of a compiled rlib?


Inlinable/generic code is included in the rlib. See @eddyb’s SO answer (different question but relevant answer):