aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/item_tree/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src/item_tree/lower.rs')
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs15
1 files changed, 11 insertions, 4 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index b1847a6cb..6e31266a2 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -325,7 +325,7 @@ impl Ctx {
325 generic_params: GenericParamsId::EMPTY, 325 generic_params: GenericParamsId::EMPTY,
326 has_self_param, 326 has_self_param,
327 is_unsafe: func.unsafe_token().is_some(), 327 is_unsafe: func.unsafe_token().is_some(),
328 params, 328 params: params.into_boxed_slice(),
329 ret_type, 329 ret_type,
330 ast_id, 330 ast_id,
331 }; 331 };
@@ -344,7 +344,14 @@ impl Ctx {
344 let bounds = self.lower_type_bounds(type_alias); 344 let bounds = self.lower_type_bounds(type_alias);
345 let generic_params = self.lower_generic_params(GenericsOwner::TypeAlias, type_alias); 345 let generic_params = self.lower_generic_params(GenericsOwner::TypeAlias, type_alias);
346 let ast_id = self.source_ast_id_map.ast_id(type_alias); 346 let ast_id = self.source_ast_id_map.ast_id(type_alias);
347 let res = TypeAlias { name, visibility, bounds, generic_params, type_ref, ast_id }; 347 let res = TypeAlias {
348 name,
349 visibility,
350 bounds: bounds.into_boxed_slice(),
351 generic_params,
352 type_ref,
353 ast_id,
354 };
348 Some(id(self.data().type_aliases.alloc(res))) 355 Some(id(self.data().type_aliases.alloc(res)))
349 } 356 }
350 357
@@ -384,7 +391,7 @@ impl Ctx {
384 }) 391 })
385 .unwrap_or_else(|| { 392 .unwrap_or_else(|| {
386 mark::hit!(name_res_works_for_broken_modules); 393 mark::hit!(name_res_works_for_broken_modules);
387 Vec::new() 394 Box::new([]) as Box<[_]>
388 }), 395 }),
389 } 396 }
390 }; 397 };
@@ -552,7 +559,7 @@ impl Ctx {
552 GenericsOwner::Function(func) => { 559 GenericsOwner::Function(func) => {
553 generics.fill(&self.body_ctx, sm, node); 560 generics.fill(&self.body_ctx, sm, node);
554 // lower `impl Trait` in arguments 561 // lower `impl Trait` in arguments
555 for param in &func.params { 562 for param in &*func.params {
556 generics.fill_implicit_impl_trait_args(param); 563 generics.fill_implicit_impl_trait_args(param);
557 } 564 }
558 } 565 }