aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/item_tree
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-14 15:15:52 +0000
committerGitHub <[email protected]>2020-12-14 15:15:52 +0000
commit817fbebbb5f9187994b1a09a603ba9c7b2755a06 (patch)
tree7f5d35fc2aad9880c6c7573d76ef0947c7b613fc /crates/hir_def/src/item_tree
parent134c7563be05d120ffb45d9b971ba95735a0fcb5 (diff)
parentc6172f3f6d3fb0982ae17f48507608609d46d179 (diff)
Merge #6862
6862: Add LifetimeParam resolving to Semantics r=matklad a=Veykril This is stuff required for the lifetime references/definitions PR. I pulled this out to make it easier to review as well as because there is one thing that still has to be addressed which can be found in the review comments. Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def/src/item_tree')
-rw-r--r--crates/hir_def/src/item_tree/lower.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_def/src/item_tree/lower.rs b/crates/hir_def/src/item_tree/lower.rs
index f7ce2e26d..2939c6b1e 100644
--- a/crates/hir_def/src/item_tree/lower.rs
+++ b/crates/hir_def/src/item_tree/lower.rs
@@ -2,7 +2,6 @@
2 2
3use std::{collections::hash_map::Entry, mem, sync::Arc}; 3use std::{collections::hash_map::Entry, mem, sync::Arc};
4 4
5use arena::map::ArenaMap;
6use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, name::known, HirFileId}; 5use hir_expand::{ast_id_map::AstIdMap, hygiene::Hygiene, name::known, HirFileId};
7use smallvec::SmallVec; 6use smallvec::SmallVec;
8use syntax::{ 7use syntax::{
@@ -607,7 +606,7 @@ impl Ctx {
607 owner: GenericsOwner<'_>, 606 owner: GenericsOwner<'_>,
608 node: &impl ast::GenericParamsOwner, 607 node: &impl ast::GenericParamsOwner,
609 ) -> GenericParamsId { 608 ) -> GenericParamsId {
610 let mut sm = &mut ArenaMap::default(); 609 let mut sm = &mut Default::default();
611 let mut generics = GenericParams::default(); 610 let mut generics = GenericParams::default();
612 match owner { 611 match owner {
613 GenericsOwner::Function(func) => { 612 GenericsOwner::Function(func) => {
@@ -630,7 +629,7 @@ impl Ctx {
630 default: None, 629 default: None,
631 provenance: TypeParamProvenance::TraitSelf, 630 provenance: TypeParamProvenance::TraitSelf,
632 }); 631 });
633 sm.insert(self_param_id, Either::Left(trait_def.clone())); 632 sm.type_params.insert(self_param_id, Either::Left(trait_def.clone()));
634 // add super traits as bounds on Self 633 // add super traits as bounds on Self
635 // i.e., trait Foo: Bar is equivalent to trait Foo where Self: Bar 634 // i.e., trait Foo: Bar is equivalent to trait Foo where Self: Bar
636 let self_param = TypeRef::Path(name![Self].into()); 635 let self_param = TypeRef::Path(name![Self].into());