▲ | layer8 7 months ago | |||||||||||||||||||||||||
How does Rust do it? | ||||||||||||||||||||||||||
▲ | steveklabnik 7 months ago | parent | next [-] | |||||||||||||||||||||||||
There’s only ever one instance of the standard library when a program is compiled, so an and b cannot depend on different versions of it. For normal libraries, an and b could depend on different versions, so this could be a problem. The name mangling scheme allows for a “disambiguator” to differentiate the two, I believe that the version is used here but the documentation for it does not say if there’s more than that. | ||||||||||||||||||||||||||
▲ | GolDDranks 7 months ago | parent | prev | next [-] | |||||||||||||||||||||||||
By linking both and not allowing mixing types, i.e. it considers types from a totally unrelated with types from b. Also, Rust compiles the whole world at once, so any ABI breakage from mixing code from different compiler versions doesn't happen. (Editions are different thing from compiler versions, a single version of the compiler supports multiple editions.) | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | 7 months ago | parent | prev [-] | |||||||||||||||||||||||||
[deleted] |