Skip to content

Commit e490665

Browse files
committed
Remove where clauses on associated type values
1 parent b953f83 commit e490665

File tree

7 files changed

+4
-20
lines changed

7 files changed

+4
-20
lines changed

chalk-parse/src/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ pub struct Impl {
115115
pub struct AssocTyValue {
116116
pub name: Identifier,
117117
pub parameter_kinds: Vec<ParameterKind>,
118-
pub where_clauses: Vec<WhereClause>,
119118
pub value: Ty,
120119
}
121120

chalk-parse/src/parser.lalrpop

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,10 @@ ParameterKind: ParameterKind = {
102102
};
103103

104104
AssocTyValue: AssocTyValue = {
105-
"type" <n:Id> <a:Angle<ParameterKind>> <wc:WhereClauses> "=" <v:Ty> ";" => AssocTyValue {
105+
"type" <n:Id> <a:Angle<ParameterKind>> "=" <v:Ty> ";" => AssocTyValue {
106106
name: n,
107107
parameter_kinds: a,
108108
value: v,
109-
where_clauses: wc,
110109
},
111110
};
112111

@@ -201,11 +200,6 @@ InlineClause: Clause = {
201200
}
202201
};
203202

204-
WhereClauses: Vec<WhereClause> = {
205-
"where" <Comma<WhereClause>>,
206-
() => vec![],
207-
};
208-
209203
QuantifiedWhereClauses: Vec<QuantifiedWhereClause> = {
210204
"where" <Comma<QuantifiedWhereClause>>,
211205
() => vec![],

src/fold/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ struct_fold!(AssociatedTyValue {
567567
associated_ty_id,
568568
value,
569569
});
570-
struct_fold!(AssociatedTyValueBound { ty, where_clauses });
570+
struct_fold!(AssociatedTyValueBound { ty });
571571
struct_fold!(Environment { clauses });
572572
struct_fold!(InEnvironment[F] { environment, goal } where F: Fold<Result = F>);
573573
struct_fold!(EqGoal { a, b });

src/ir/lowering/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,6 @@ impl LowerAssocTyValue for AssocTyValue {
872872
let value = env.in_binders(self.all_parameters(), |env| {
873873
Ok(ir::AssociatedTyValueBound {
874874
ty: self.value.lower(env)?,
875-
where_clauses: self.where_clauses.lower(env)?,
876875
})
877876
})?;
878877
Ok(ir::AssociatedTyValue {

src/ir/lowering/test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@ fn atc_accounting() {
211211
AssociatedTyValue {
212212
associated_ty_id: (Iterable::Iter),
213213
value: for<lifetime> AssociatedTyValueBound {
214-
ty: Iter<'?0, ?1>,
215-
where_clauses: []
214+
ty: Iter<'?0, ?1>
216215
}
217216
}
218217
],

src/ir/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,6 @@ pub struct AssociatedTyValue {
289289
pub struct AssociatedTyValueBound {
290290
/// Type that we normalize to. The X in `type Foo<'a> = X`.
291291
crate ty: Ty,
292-
293-
/// Where-clauses that must hold for projection to be valid. The
294-
/// WC in `type Foo<'a> = X where WC`.
295-
crate where_clauses: Vec<DomainGoal>,
296292
}
297293

298294
#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]

src/rules/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,7 @@ impl ir::AssociatedTyValue {
200200
.trait_ref
201201
.trait_ref()
202202
.up_shift(self.value.len());
203-
let conditions: Vec<ir::Goal> = Some(impl_trait_ref.clone().cast())
204-
.into_iter()
205-
.chain(self.value.value.where_clauses.clone().cast())
206-
.collect();
203+
let conditions: Vec<ir::Goal> = vec![impl_trait_ref.clone().cast()];
207204

208205
// Bound parameters + `Self` type of the trait-ref
209206
let parameters: Vec<_> = {

0 commit comments

Comments
 (0)