diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-15 17:22:03 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-15 17:22:03 +0000 |
commit | eb9ba457b0126bd45c45ef751e92ccfdc5fdc206 (patch) | |
tree | 5af185ffaa39f285ce85aaccb2eb6bb5f532e26c /crates/hir_def/src/adt.rs | |
parent | bd4c352831662762ee7a66da77ec9adf623b0a0a (diff) | |
parent | 2c67a4abe47ead6a00ce1b33ccc3d3bfcaaf0983 (diff) |
Merge #6879
6879: Change HasChildSource::ChildId assoc item to generic param r=matklad a=Veykril
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def/src/adt.rs')
-rw-r--r-- | crates/hir_def/src/adt.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/hir_def/src/adt.rs b/crates/hir_def/src/adt.rs index 6539959c3..eafa3abb6 100644 --- a/crates/hir_def/src/adt.rs +++ b/crates/hir_def/src/adt.rs | |||
@@ -145,10 +145,12 @@ impl EnumData { | |||
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | impl HasChildSource for EnumId { | 148 | impl HasChildSource<LocalEnumVariantId> for EnumId { |
149 | type ChildId = LocalEnumVariantId; | ||
150 | type Value = ast::Variant; | 149 | type Value = ast::Variant; |
151 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { | 150 | fn child_source( |
151 | &self, | ||
152 | db: &dyn DefDatabase, | ||
153 | ) -> InFile<ArenaMap<LocalEnumVariantId, Self::Value>> { | ||
152 | let src = self.lookup(db).source(db); | 154 | let src = self.lookup(db).source(db); |
153 | let mut trace = Trace::new_for_map(); | 155 | let mut trace = Trace::new_for_map(); |
154 | lower_enum(db, &mut trace, &src, self.lookup(db).container.module(db)); | 156 | lower_enum(db, &mut trace, &src, self.lookup(db).container.module(db)); |
@@ -212,11 +214,10 @@ impl VariantData { | |||
212 | } | 214 | } |
213 | } | 215 | } |
214 | 216 | ||
215 | impl HasChildSource for VariantId { | 217 | impl HasChildSource<LocalFieldId> for VariantId { |
216 | type ChildId = LocalFieldId; | ||
217 | type Value = Either<ast::TupleField, ast::RecordField>; | 218 | type Value = Either<ast::TupleField, ast::RecordField>; |
218 | 219 | ||
219 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<Self::ChildId, Self::Value>> { | 220 | fn child_source(&self, db: &dyn DefDatabase) -> InFile<ArenaMap<LocalFieldId, Self::Value>> { |
220 | let (src, module_id) = match self { | 221 | let (src, module_id) = match self { |
221 | VariantId::EnumVariantId(it) => { | 222 | VariantId::EnumVariantId(it) => { |
222 | // I don't really like the fact that we call into parent source | 223 | // I don't really like the fact that we call into parent source |