diff options
-rw-r--r-- | crates/hir_ty/src/traits/chalk.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 4e7d43f7e..1a2a3a8c7 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs | |||
@@ -487,19 +487,14 @@ pub(crate) fn struct_datum_query( | |||
487 | struct_id: AdtId, | 487 | struct_id: AdtId, |
488 | ) -> Arc<StructDatum> { | 488 | ) -> Arc<StructDatum> { |
489 | debug!("struct_datum {:?}", struct_id); | 489 | debug!("struct_datum {:?}", struct_id); |
490 | let type_ctor = Ty::Adt(struct_id, Substs::empty()); | ||
491 | let chalk_ir::AdtId(adt_id) = struct_id; | 490 | let chalk_ir::AdtId(adt_id) = struct_id; |
492 | debug!("struct {:?} = {:?}", struct_id, type_ctor); | ||
493 | let num_params = generics(db.upcast(), adt_id.into()).len(); | 491 | let num_params = generics(db.upcast(), adt_id.into()).len(); |
494 | let upstream = adt_id.module(db.upcast()).krate() != krate; | 492 | let upstream = adt_id.module(db.upcast()).krate() != krate; |
495 | let where_clauses = type_ctor | 493 | let where_clauses = { |
496 | .as_generic_def() | 494 | let generic_params = generics(db.upcast(), adt_id.into()); |
497 | .map(|generic_def| { | 495 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); |
498 | let generic_params = generics(db.upcast(), generic_def); | 496 | convert_where_clauses(db, adt_id.into(), &bound_vars) |
499 | let bound_vars = Substs::bound_vars(&generic_params, DebruijnIndex::INNERMOST); | 497 | }; |
500 | convert_where_clauses(db, generic_def, &bound_vars) | ||
501 | }) | ||
502 | .unwrap_or_else(Vec::new); | ||
503 | let flags = rust_ir::AdtFlags { | 498 | let flags = rust_ir::AdtFlags { |
504 | upstream, | 499 | upstream, |
505 | // FIXME set fundamental and phantom_data flags correctly | 500 | // FIXME set fundamental and phantom_data flags correctly |