diff options
| author | Michael Goulet <michael@errs.io> | 2024-12-10 19:50:40 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-12-10 19:50:47 +0000 |
| commit | 916d279236ad017c0c1955c1d7951fa3ea09bf16 (patch) | |
| tree | 49900f24e22b9cd84d9b5a6b48ccb93cd1e4f001 /compiler/rustc_hir/src | |
| parent | 33c245b9e98bc91e18ea1c5033824f4c6f92766f (diff) | |
| download | rust-916d279236ad017c0c1955c1d7951fa3ea09bf16.tar.gz rust-916d279236ad017c0c1955c1d7951fa3ea09bf16.zip | |
Remove more traces of anonymous ADTs
Diffstat (limited to 'compiler/rustc_hir/src')
| -rw-r--r-- | compiler/rustc_hir/src/def.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/definitions.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/hir.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/intravisit.rs | 3 |
4 files changed, 1 insertions, 11 deletions
diff --git a/compiler/rustc_hir/src/def.rs b/compiler/rustc_hir/src/def.rs index 0b7ffc4af45..705de389e07 100644 --- a/compiler/rustc_hir/src/def.rs +++ b/compiler/rustc_hir/src/def.rs @@ -9,7 +9,6 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic}; use rustc_span::Symbol; use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::hygiene::MacroKind; -use rustc_span::symbol::kw; use crate::definitions::DefPathData; use crate::hir; @@ -256,7 +255,6 @@ impl DefKind { pub fn def_path_data(self, name: Symbol) -> DefPathData { match self { - DefKind::Struct | DefKind::Union if name == kw::Empty => DefPathData::AnonAdt, DefKind::Mod | DefKind::Struct | DefKind::Union diff --git a/compiler/rustc_hir/src/definitions.rs b/compiler/rustc_hir/src/definitions.rs index 9873a58cfe9..d85f9586d42 100644 --- a/compiler/rustc_hir/src/definitions.rs +++ b/compiler/rustc_hir/src/definitions.rs @@ -289,8 +289,6 @@ pub enum DefPathData { /// An existential `impl Trait` type node. /// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name. OpaqueTy, - /// An anonymous struct or union type i.e. `struct { foo: Type }` or `union { bar: Type }` - AnonAdt, } impl Definitions { @@ -415,7 +413,7 @@ impl DefPathData { TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name), Impl | ForeignMod | CrateRoot | Use | GlobalAsm | Closure | Ctor | AnonConst - | OpaqueTy | AnonAdt => None, + | OpaqueTy => None, } } @@ -438,7 +436,6 @@ impl DefPathData { Ctor => DefPathDataName::Anon { namespace: sym::constructor }, AnonConst => DefPathDataName::Anon { namespace: sym::constant }, OpaqueTy => DefPathDataName::Anon { namespace: sym::opaque }, - AnonAdt => DefPathDataName::Anon { namespace: sym::anon_adt }, } } } diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 365e4cbb556..4800a479ff4 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -2882,8 +2882,6 @@ pub enum TyKind<'hir> { Never, /// A tuple (`(A, B, C, D, ...)`). Tup(&'hir [Ty<'hir>]), - /// An anonymous struct or union type i.e. `struct { foo: Type }` or `union { foo: Type }` - AnonAdt(ItemId), /// A path to a type definition (`module::module::...::Type`), or an /// associated type (e.g., `<Vec<T> as Trait>::Type` or `<T>::Target`). /// diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index 9abb0870bf0..8dbfefffee4 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -904,9 +904,6 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul } TyKind::Typeof(ref expression) => try_visit!(visitor.visit_anon_const(expression)), TyKind::Infer | TyKind::InferDelegation(..) | TyKind::Err(_) => {} - TyKind::AnonAdt(item_id) => { - try_visit!(visitor.visit_nested_item(item_id)); - } TyKind::Pat(ty, pat) => { try_visit!(visitor.visit_ty(ty)); try_visit!(visitor.visit_pattern_type_pattern(pat)); |
