aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-03-12 19:51:08 +0000
committerFlorian Diebold <[email protected]>2021-03-12 19:51:29 +0000
commit784636f1c15c2b29d9cbdb5b40acfdc519cc601d (patch)
treef36391dfb670f7ce5ac4b7bbddcb59bf6d045c02 /crates/hir_ty
parent05814e542fe6a303aa2a0d23411391d904d1fa26 (diff)
Simplify a bit
Diffstat (limited to 'crates/hir_ty')
-rw-r--r--crates/hir_ty/src/traits/chalk.rs15
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