Rollup merge of #92032 - petrochenkov:extblockpath, r=oli-obk

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

Use a separate nameless `DefPathData` variant instead.

Extracted from https://github.com/rust-lang/rust/pull/91795.
This commit is contained in:
Matthias Krüger 2021-12-18 11:28:07 +01:00 committed by GitHub
commit 5e8f934149
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 36 additions and 31 deletions

View file

@ -1030,8 +1030,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);
}