Name generation during monomorphization

I am interested in knowing how rust generates names for structures (like struct, methods and functions) containing generic type parameters so that they avoid collision with already present possible other structure like for example if there is scheme that take Node::<int, str, bool> and gives Node_int_str_bool, but what if there is already an struct with this name in the original code making it collide in the monomorphized code. So I guess this scheme does not work, I want to know what scheme does rust uses to convert a generic typed structure while converting them with concrete types ?

You want to ask how Rust does name mangling, I guess. There's RFC which links to other resources.

1 Like

Ohh @khimru thank you so much. This doc is exactly what I was looking for. Will read it once and ask more doubts on forum only. Thanks again :smiley:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.