diff options
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 4bd8ba303..bef6e7e9c 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -22,7 +22,7 @@ use crate::{ | |||
22 | to_assoc_type_id, | 22 | to_assoc_type_id, |
23 | utils::generics, | 23 | utils::generics, |
24 | BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, GenericPredicate, | 24 | BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, GenericPredicate, |
25 | ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TyKind, | 25 | ProjectionPredicate, ProjectionTy, Substitution, TraitRef, Ty, TyKind, |
26 | }; | 26 | }; |
27 | use mapping::{ | 27 | use mapping::{ |
28 | convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsValue, | 28 | convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsValue, |
@@ -221,7 +221,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
221 | let impl_bound = GenericPredicate::Implemented(TraitRef { | 221 | let impl_bound = GenericPredicate::Implemented(TraitRef { |
222 | trait_: future_trait, | 222 | trait_: future_trait, |
223 | // Self type as the first parameter. | 223 | // Self type as the first parameter. |
224 | substs: Substs::single( | 224 | substs: Substitution::single( |
225 | TyKind::BoundVar(BoundVar { | 225 | TyKind::BoundVar(BoundVar { |
226 | debruijn: DebruijnIndex::INNERMOST, | 226 | debruijn: DebruijnIndex::INNERMOST, |
227 | index: 0, | 227 | index: 0, |
@@ -236,7 +236,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
236 | projection_ty: ProjectionTy { | 236 | projection_ty: ProjectionTy { |
237 | associated_ty_id: to_assoc_type_id(future_output), | 237 | associated_ty_id: to_assoc_type_id(future_output), |
238 | // Self type as the first parameter. | 238 | // Self type as the first parameter. |
239 | substitution: Substs::single( | 239 | substitution: Substitution::single( |
240 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) | 240 | TyKind::BoundVar(BoundVar::new(DebruijnIndex::INNERMOST, 0)) |
241 | .intern(&Interner), | 241 | .intern(&Interner), |
242 | ), | 242 | ), |
@@ -313,7 +313,7 @@ impl<'a> chalk_solve::RustIrDatabase<Interner> for ChalkContext<'a> { | |||
313 | _closure_id: chalk_ir::ClosureId<Interner>, | 313 | _closure_id: chalk_ir::ClosureId<Interner>, |
314 | _substs: &chalk_ir::Substitution<Interner>, | 314 | _substs: &chalk_ir::Substitution<Interner>, |
315 | ) -> chalk_ir::Substitution<Interner> { | 315 | ) -> chalk_ir::Substitution<Interner> { |
316 | Substs::empty().to_chalk(self.db) | 316 | Substitution::empty().to_chalk(self.db) |
317 | } | 317 | } |
318 | 318 | ||
319 | fn trait_name(&self, trait_id: chalk_ir::TraitId<Interner>) -> String { | 319 | fn trait_name(&self, trait_id: chalk_ir::TraitId<Interner>) -> String { |
@@ -392,7 +392,7 @@ pub(crate) fn associated_ty_data_query( | |||
392 | // Lower bounds -- we could/should maybe move this to a separate query in `lower` | 392 | // Lower bounds -- we could/should maybe move this to a separate query in `lower` |
393 | let type_alias_data = db.type_alias_data(type_alias); | 393 | let type_alias_data = db.type_alias_data(type_alias); |
394 | let generic_params = generics(db.upcast(), type_alias.into()); | 394 | let generic_params = generics(db.upcast(), type_alias.into()); |
395 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 395 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
396 | let resolver = hir_def::resolver::HasResolver::resolver(type_alias, db.upcast()); | 396 | let resolver = hir_def::resolver::HasResolver::resolver(type_alias, db.upcast()); |
397 | let ctx = crate::TyLoweringContext::new(db, &resolver) | 397 | let ctx = crate::TyLoweringContext::new(db, &resolver) |
398 | .with_type_param_mode(crate::lower::TypeParamLoweringMode::Variable); | 398 | .with_type_param_mode(crate::lower::TypeParamLoweringMode::Variable); |
@@ -427,7 +427,7 @@ pub(crate) fn trait_datum_query( | |||
427 | let trait_data = db.trait_data(trait_); | 427 | let trait_data = db.trait_data(trait_); |
428 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); | 428 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); |
429 | let generic_params = generics(db.upcast(), trait_.into()); | 429 | let generic_params = generics(db.upcast(), trait_.into()); |
430 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 430 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
431 | let flags = rust_ir::TraitFlags { | 431 | let flags = rust_ir::TraitFlags { |
432 | auto: trait_data.is_auto, | 432 | auto: trait_data.is_auto, |
433 | upstream: trait_.lookup(db.upcast()).container.krate() != krate, | 433 | upstream: trait_.lookup(db.upcast()).container.krate() != krate, |
@@ -496,7 +496,7 @@ pub(crate) fn struct_datum_query( | |||
496 | let upstream = adt_id.module(db.upcast()).krate() != krate; | 496 | let upstream = adt_id.module(db.upcast()).krate() != krate; |
497 | let where_clauses = { | 497 | let where_clauses = { |
498 | let generic_params = generics(db.upcast(), adt_id.into()); | 498 | let generic_params = generics(db.upcast(), adt_id.into()); |
499 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 499 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
500 | convert_where_clauses(db, adt_id.into(), &bound_vars) | 500 | convert_where_clauses(db, adt_id.into(), &bound_vars) |
501 | }; | 501 | }; |
502 | let flags = rust_ir::AdtFlags { | 502 | let flags = rust_ir::AdtFlags { |
@@ -545,7 +545,7 @@ fn impl_def_datum( | |||
545 | let impl_data = db.impl_data(impl_id); | 545 | let impl_data = db.impl_data(impl_id); |
546 | 546 | ||
547 | let generic_params = generics(db.upcast(), impl_id.into()); | 547 | let generic_params = generics(db.upcast(), impl_id.into()); |
548 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 548 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
549 | let trait_ = trait_ref.trait_; | 549 | let trait_ = trait_ref.trait_; |
550 | let impl_type = if impl_id.lookup(db.upcast()).container.krate() == krate { | 550 | let impl_type = if impl_id.lookup(db.upcast()).container.krate() == krate { |
551 | rust_ir::ImplType::Local | 551 | rust_ir::ImplType::Local |
@@ -635,7 +635,7 @@ pub(crate) fn fn_def_datum_query( | |||
635 | let callable_def: CallableDefId = from_chalk(db, fn_def_id); | 635 | let callable_def: CallableDefId = from_chalk(db, fn_def_id); |
636 | let generic_params = generics(db.upcast(), callable_def.into()); | 636 | let generic_params = generics(db.upcast(), callable_def.into()); |
637 | let sig = db.callable_item_signature(callable_def); | 637 | let sig = db.callable_item_signature(callable_def); |
638 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 638 | let bound_vars = Substitution::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
639 | let where_clauses = convert_where_clauses(db, callable_def.into(), &bound_vars); | 639 | let where_clauses = convert_where_clauses(db, callable_def.into(), &bound_vars); |
640 | let bound = rust_ir::FnDefDatumBound { | 640 | let bound = rust_ir::FnDefDatumBound { |
641 | // Note: Chalk doesn't actually use this information yet as far as I am aware, but we provide it anyway | 641 | // Note: Chalk doesn't actually use this information yet as far as I am aware, but we provide it anyway |