aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-12 19:52:07 +0000
committerGitHub <[email protected]>2021-03-12 19:52:07 +0000
commit437527b22612a17024751c78f69715e625bf6a96 (patch)
treef36391dfb670f7ce5ac4b7bbddcb59bf6d045c02 /crates/hir_ty/src
parent05814e542fe6a303aa2a0d23411391d904d1fa26 (diff)
parent784636f1c15c2b29d9cbdb5b40acfdc519cc601d (diff)
Merge #7986
7986: Simplify a bit r=flodiebold a=flodiebold Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/hir_ty/src')
-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