]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_symbol_mangling/src/v0.rs
Rollup merge of #92316 - petrochenkov:extmangle, r=wesleywiser
[rust.git] / compiler / rustc_symbol_mangling / src / v0.rs
index 809b9732529742663d94b487fb33dd1a32099dc5..0d51f7779e18f8844a284007f1a278b7709c69f2 100644 (file)
@@ -772,9 +772,9 @@ fn path_append(
         disambiguated_data: &DisambiguatedDefPathData,
     ) -> Result<Self::Path, Self::Error> {
         let ns = match disambiguated_data.data {
-            // FIXME: It shouldn't be necessary to add anything for extern block segments,
-            // but we add 't' for backward compatibility.
-            DefPathData::ForeignMod => 't',
+            // Extern block segments can be skipped, names from extern blocks
+            // are effectively living in their parent modules.
+            DefPathData::ForeignMod => return print_prefix(self),
 
             // Uppercase categories are more stable than lowercase ones.
             DefPathData::TypeNs(_) => 't',