diff options
| author | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-15 09:46:22 +0000 |
|---|---|---|
| committer | The rustc-dev-guide Cronjob Bot <github-actions@github.com> | 2025-05-15 09:46:22 +0000 |
| commit | 1fd536c5fb7616f08973dd33074efb94e82eea44 (patch) | |
| tree | 7b32415cdda158f9c51d195f0f03921c86d8892a /compiler/rustc_hir/src/definitions.rs | |
| parent | 4adff2f244140be9ac78c0bd6774bf5acb828029 (diff) | |
| parent | 414482f6a0d4e7290f614300581a0b55442552a3 (diff) | |
| download | rust-1fd536c5fb7616f08973dd33074efb94e82eea44.tar.gz rust-1fd536c5fb7616f08973dd33074efb94e82eea44.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_hir/src/definitions.rs')
| -rw-r--r-- | compiler/rustc_hir/src/definitions.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index 98b41187f11..f93b9e5af53 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -309,6 +309,8 @@ pub enum DefPathData { /// An existential `impl Trait` type node. /// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name. OpaqueTy, + /// Used for remapped captured lifetimes in an existential `impl Trait` type node. + OpaqueLifetime(Symbol), /// An anonymous associated type from an RPITIT. The symbol refers to the name of the method /// that defined the type. AnonAssocTy(Symbol), @@ -445,7 +447,8 @@ impl DefPathData { pub fn get_opt_name(&self) -> Option<Symbol> { use self::DefPathData::*; match *self { - TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name), + TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) + | OpaqueLifetime(name) => Some(name), Impl | ForeignMod @@ -465,9 +468,8 @@ impl DefPathData { fn hashed_symbol(&self) -> Option<Symbol> { use self::DefPathData::*; match *self { - TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) | AnonAssocTy(name) => { - Some(name) - } + TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) | AnonAssocTy(name) + | OpaqueLifetime(name) => Some(name), Impl | ForeignMod @@ -486,9 +488,8 @@ impl DefPathData { pub fn name(&self) -> DefPathDataName { use self::DefPathData::*; match *self { - TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => { - DefPathDataName::Named(name) - } + TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) + | OpaqueLifetime(name) => DefPathDataName::Named(name), // Note that this does not show up in user print-outs. CrateRoot => DefPathDataName::Anon { namespace: kw::Crate }, Impl => DefPathDataName::Anon { namespace: kw::Impl }, |
