diff options
Diffstat (limited to 'crates/hir')
-rw-r--r-- | crates/hir/src/display.rs | 2 | ||||
-rw-r--r-- | crates/hir/src/lib.rs | 6 | ||||
-rw-r--r-- | crates/hir/src/source_analyzer.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 993772aac..d4e477a85 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs | |||
@@ -235,7 +235,7 @@ impl HirDisplay for TypeParam { | |||
235 | write!(f, "{}", self.name(f.db))?; | 235 | write!(f, "{}", self.name(f.db))?; |
236 | let bounds = f.db.generic_predicates_for_param(self.id); | 236 | let bounds = f.db.generic_predicates_for_param(self.id); |
237 | let substs = TyBuilder::type_params_subst(f.db, self.id.parent); | 237 | let substs = TyBuilder::type_params_subst(f.db, self.id.parent); |
238 | let predicates = bounds.iter().cloned().map(|b| b.subst(&substs)).collect::<Vec<_>>(); | 238 | let predicates = bounds.iter().cloned().map(|b| b.substitute(&substs)).collect::<Vec<_>>(); |
239 | if !(predicates.is_empty() || f.omit_verbose_types()) { | 239 | if !(predicates.is_empty() || f.omit_verbose_types()) { |
240 | write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; | 240 | write_bounds_like_dyn_trait_with_prefix(":", &predicates, f)?; |
241 | } | 241 | } |
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index ccfe348a4..add1b55c2 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs | |||
@@ -516,7 +516,7 @@ impl Field { | |||
516 | VariantDef::Variant(it) => it.parent.id.into(), | 516 | VariantDef::Variant(it) => it.parent.id.into(), |
517 | }; | 517 | }; |
518 | let substs = TyBuilder::type_params_subst(db, generic_def_id); | 518 | let substs = TyBuilder::type_params_subst(db, generic_def_id); |
519 | let ty = db.field_types(var_id)[self.id].clone().subst(&substs); | 519 | let ty = db.field_types(var_id)[self.id].clone().substitute(&substs); |
520 | Type::new(db, self.parent.module(db).id.krate(), var_id, ty) | 520 | Type::new(db, self.parent.module(db).id.krate(), var_id, ty) |
521 | } | 521 | } |
522 | 522 | ||
@@ -1503,7 +1503,7 @@ impl TypeParam { | |||
1503 | let krate = self.id.parent.module(db.upcast()).krate(); | 1503 | let krate = self.id.parent.module(db.upcast()).krate(); |
1504 | let ty = params.get(local_idx)?.clone(); | 1504 | let ty = params.get(local_idx)?.clone(); |
1505 | let subst = TyBuilder::type_params_subst(db, self.id.parent); | 1505 | let subst = TyBuilder::type_params_subst(db, self.id.parent); |
1506 | let ty = ty.subst(&subst.prefix(local_idx)); | 1506 | let ty = ty.substitute(&subst.prefix(local_idx)); |
1507 | Some(Type::new_with_resolver_inner(db, krate, &resolver, ty)) | 1507 | Some(Type::new_with_resolver_inner(db, krate, &resolver, ty)) |
1508 | } | 1508 | } |
1509 | } | 1509 | } |
@@ -1916,7 +1916,7 @@ impl Type { | |||
1916 | .iter() | 1916 | .iter() |
1917 | .map(|(local_id, ty)| { | 1917 | .map(|(local_id, ty)| { |
1918 | let def = Field { parent: variant_id.into(), id: local_id }; | 1918 | let def = Field { parent: variant_id.into(), id: local_id }; |
1919 | let ty = ty.clone().subst(substs); | 1919 | let ty = ty.clone().substitute(substs); |
1920 | (def, self.derived(ty)) | 1920 | (def, self.derived(ty)) |
1921 | }) | 1921 | }) |
1922 | .collect() | 1922 | .collect() |
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 8e9ea0a03..82807ea09 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs | |||
@@ -339,7 +339,7 @@ impl SourceAnalyzer { | |||
339 | .into_iter() | 339 | .into_iter() |
340 | .map(|local_id| { | 340 | .map(|local_id| { |
341 | let field = FieldId { parent: variant, local_id }; | 341 | let field = FieldId { parent: variant, local_id }; |
342 | let ty = field_types[local_id].clone().subst(substs); | 342 | let ty = field_types[local_id].clone().substitute(substs); |
343 | (field.into(), Type::new_with_resolver_inner(db, krate, &self.resolver, ty)) | 343 | (field.into(), Type::new_with_resolver_inner(db, krate, &self.resolver, ty)) |
344 | }) | 344 | }) |
345 | .collect() | 345 | .collect() |