diff options
author | Benjamin Coenen <[email protected]> | 2020-04-18 16:14:24 +0100 |
---|---|---|
committer | Benjamin Coenen <[email protected]> | 2020-04-18 16:14:24 +0100 |
commit | af3c19e85f55db9277ce9ad5b784df2ccfe3c9e4 (patch) | |
tree | 7a777f22f5fa79704b8d2c9aa8d67255d12123be /crates/ra_hir_ty/src/traits | |
parent | 379787858bbfb2691e134942d94fcbc70c5d1d7f (diff) | |
parent | 84e3304a9bf0d68e30d58b1e37a6db2e9ec97525 (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer
Diffstat (limited to 'crates/ra_hir_ty/src/traits')
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk.rs b/crates/ra_hir_ty/src/traits/chalk.rs index 60d70d18e..e00a82db2 100644 --- a/crates/ra_hir_ty/src/traits/chalk.rs +++ b/crates/ra_hir_ty/src/traits/chalk.rs | |||
@@ -17,7 +17,7 @@ use ra_db::{ | |||
17 | use super::{builtin, AssocTyValue, Canonical, ChalkContext, Impl, Obligation}; | 17 | use super::{builtin, AssocTyValue, Canonical, ChalkContext, Impl, Obligation}; |
18 | use crate::{ | 18 | use crate::{ |
19 | db::HirDatabase, display::HirDisplay, method_resolution::TyFingerprint, utils::generics, | 19 | db::HirDatabase, display::HirDisplay, method_resolution::TyFingerprint, utils::generics, |
20 | ApplicationTy, GenericPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 20 | ApplicationTy, DebruijnIndex, GenericPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
21 | }; | 21 | }; |
22 | 22 | ||
23 | pub(super) mod tls; | 23 | pub(super) mod tls; |
@@ -815,7 +815,7 @@ pub(crate) fn associated_ty_data_query( | |||
815 | // Lower bounds -- we could/should maybe move this to a separate query in `lower` | 815 | // Lower bounds -- we could/should maybe move this to a separate query in `lower` |
816 | let type_alias_data = db.type_alias_data(type_alias); | 816 | let type_alias_data = db.type_alias_data(type_alias); |
817 | let generic_params = generics(db.upcast(), type_alias.into()); | 817 | let generic_params = generics(db.upcast(), type_alias.into()); |
818 | let bound_vars = Substs::bound_vars(&generic_params); | 818 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
819 | let resolver = hir_def::resolver::HasResolver::resolver(type_alias, db.upcast()); | 819 | let resolver = hir_def::resolver::HasResolver::resolver(type_alias, db.upcast()); |
820 | let ctx = crate::TyLoweringContext::new(db, &resolver) | 820 | let ctx = crate::TyLoweringContext::new(db, &resolver) |
821 | .with_type_param_mode(crate::lower::TypeParamLoweringMode::Variable); | 821 | .with_type_param_mode(crate::lower::TypeParamLoweringMode::Variable); |
@@ -849,7 +849,7 @@ pub(crate) fn trait_datum_query( | |||
849 | let trait_data = db.trait_data(trait_); | 849 | let trait_data = db.trait_data(trait_); |
850 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); | 850 | debug!("trait {:?} = {:?}", trait_id, trait_data.name); |
851 | let generic_params = generics(db.upcast(), trait_.into()); | 851 | let generic_params = generics(db.upcast(), trait_.into()); |
852 | let bound_vars = Substs::bound_vars(&generic_params); | 852 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
853 | let flags = chalk_rust_ir::TraitFlags { | 853 | let flags = chalk_rust_ir::TraitFlags { |
854 | auto: trait_data.auto, | 854 | auto: trait_data.auto, |
855 | upstream: trait_.lookup(db.upcast()).container.module(db.upcast()).krate != krate, | 855 | upstream: trait_.lookup(db.upcast()).container.module(db.upcast()).krate != krate, |
@@ -888,7 +888,7 @@ pub(crate) fn struct_datum_query( | |||
888 | .as_generic_def() | 888 | .as_generic_def() |
889 | .map(|generic_def| { | 889 | .map(|generic_def| { |
890 | let generic_params = generics(db.upcast(), generic_def); | 890 | let generic_params = generics(db.upcast(), generic_def); |
891 | let bound_vars = Substs::bound_vars(&generic_params); | 891 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
892 | convert_where_clauses(db, generic_def, &bound_vars) | 892 | convert_where_clauses(db, generic_def, &bound_vars) |
893 | }) | 893 | }) |
894 | .unwrap_or_else(Vec::new); | 894 | .unwrap_or_else(Vec::new); |
@@ -934,7 +934,7 @@ fn impl_def_datum( | |||
934 | let impl_data = db.impl_data(impl_id); | 934 | let impl_data = db.impl_data(impl_id); |
935 | 935 | ||
936 | let generic_params = generics(db.upcast(), impl_id.into()); | 936 | let generic_params = generics(db.upcast(), impl_id.into()); |
937 | let bound_vars = Substs::bound_vars(&generic_params); | 937 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
938 | let trait_ = trait_ref.trait_; | 938 | let trait_ = trait_ref.trait_; |
939 | let impl_type = if impl_id.lookup(db.upcast()).container.module(db.upcast()).krate == krate { | 939 | let impl_type = if impl_id.lookup(db.upcast()).container.module(db.upcast()).krate == krate { |
940 | chalk_rust_ir::ImplType::Local | 940 | chalk_rust_ir::ImplType::Local |