diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-02-28 19:16:51 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-02-28 19:16:51 +0000 |
commit | 2fc137b70f9d455676cc99a1a5c7e6e10c3e7cc2 (patch) | |
tree | b9bc6434404e99a0829d01b08285d37f6faa3d2d /crates/hir_ty/src/traits/chalk.rs | |
parent | 0a913fd11194faff9c0100bc78f2d4fe682075aa (diff) | |
parent | faf2dd49e4845e1437b704a28bb5603be5fd605b (diff) |
Merge #7813
7813: Inline TypeCtor into Ty r=flodiebold a=Veykril
This removes the `ApplicationTy` variant from `Ty` bringing the representation a lot closer to chalk's `TyKind`.
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/traits/chalk.rs')
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index d74c83737..c53e327da 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -20,7 +20,7 @@ use crate::{ | |||
20 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, | 20 | method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, |
21 | utils::generics, | 21 | utils::generics, |
22 | BoundVar, CallableDefId, DebruijnIndex, FnSig, GenericPredicate, ProjectionPredicate, | 22 | BoundVar, CallableDefId, DebruijnIndex, FnSig, GenericPredicate, ProjectionPredicate, |
23 | ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 23 | ProjectionTy, Substs, TraitRef, Ty, |
24 | }; | 24 | }; |
25 | use mapping::{ | 25 | use mapping::{ |
26 | convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsAssocType, | 26 | convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsAssocType, |
@@ -489,10 +489,11 @@ pub(crate) fn struct_datum_query( | |||
489 | struct_id: AdtId, | 489 | struct_id: AdtId, |
490 | ) -> Arc<StructDatum> { | 490 | ) -> Arc<StructDatum> { |
491 | debug!("struct_datum {:?}", struct_id); | 491 | debug!("struct_datum {:?}", struct_id); |
492 | let type_ctor = TypeCtor::Adt(from_chalk(db, struct_id)); | 492 | let adt_id = from_chalk(db, struct_id); |
493 | let type_ctor = Ty::Adt(adt_id, Substs::empty()); | ||
493 | debug!("struct {:?} = {:?}", struct_id, type_ctor); | 494 | debug!("struct {:?} = {:?}", struct_id, type_ctor); |
494 | let num_params = type_ctor.num_ty_params(db); | 495 | let num_params = generics(db.upcast(), adt_id.into()).len(); |
495 | let upstream = type_ctor.krate(db) != Some(krate); | 496 | let upstream = adt_id.module(db.upcast()).krate() != krate; |
496 | let where_clauses = type_ctor | 497 | let where_clauses = type_ctor |
497 | .as_generic_def() | 498 | .as_generic_def() |
498 | .map(|generic_def| { | 499 | .map(|generic_def| { |