1
Fork 0

hir: Do not introduce dummy type names for extern blocks in def paths

Use a separate nameless `DefPathData` variant instead
This commit is contained in:
Vadim Petrochenkov 2021-12-17 16:45:15 +08:00
parent dde825db46
commit 0d61852cc5
8 changed files with 36 additions and 31 deletions

View file

@ -1040,8 +1040,8 @@ impl<'tcx> LateContext<'tcx> {
) -> Result<Self::Path, Self::Error> {
let mut path = print_prefix(self)?;
// Skip `::{{constructor}}` on tuple/unit structs.
if let DefPathData::Ctor = disambiguated_data.data {
// Skip `::{{extern}}` blocks and `::{{constructor}}` on tuple/unit structs.
if let DefPathData::ForeignMod | DefPathData::Ctor = disambiguated_data.data {
return Ok(path);
}