]> git.lizzy.rs Git - rust.git/commit
auto merge of #15199 : michaelwoerister/rust/cross-crate-stability, r=luqmana
authorbors <bors@rust-lang.org>
Thu, 3 Jul 2014 10:46:39 +0000 (10:46 +0000)
committerbors <bors@rust-lang.org>
Thu, 3 Jul 2014 10:46:39 +0000 (10:46 +0000)
commit550cc045e2241005f9de3034a412cf3ae162d453
treef2631d1d90bc912105ab5321e93450a4c3000114
parente26d0a7a36439497ccc6994110e97d79c924c2d7
parent40e05413096bbd5f35e566e796f525742076600f
auto merge of #15199 : michaelwoerister/rust/cross-crate-stability, r=luqmana

So far, type names generated for debuginfo where a bit sketchy. It was not clearly defined when a name should be fully qualified and when not, if region parameters should be shown or not, and other things like that.
This commit makes the debuginfo module responsible for creating type names instead of using `ppaux::ty_to_str()` and brings type names (as they show up in the DWARF information) in line with GCC and Clang:

* The name of the type being described is unqualified. It's path is defined by its position in the namespace hierarchy.
* Type arguments are always fully qualified, no matter if they would actually be in scope at the type definition location.

Care is also taken to make type names consistent across crate boundaries. That is, the code now tries make the type name the same, regardless if the type is in the local crate or reconstructed from metadata. Otherwise LLVM will complain about violating the one-definition-rule when using link-time-optimization.

This commit also removes all source location information from type descriptions because these cannot be reconstructed for types instantiated from metadata. Again, with LTO enabled, this can lead to two versions of the debuginfo type description, one with and one without source location information, which then triggers the LLVM ODR assertion.
Fortunately, source location information about types is rarely used, so this has little impact. Once source location information is preserved in metadata (#1972) it can also be re-enabled for type descriptions.

`RUSTFLAGS=-g make check` no works again for me locally, including the LTO test cases (note that I've taken care of #15156 by reverting the change in LLVM that @luqmana identified as the culprit for that issue).