Skip to content

Commit 0c89f42

Browse files
committed
Rename some more instances of Projection to Alias
1 parent 3cd4f9c commit 0c89f42

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

chalk-ir/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<TF: TypeFamily> Ty<TF> {
216216
}
217217
}
218218

219-
pub fn is_projection(&self) -> bool {
219+
pub fn is_alias(&self) -> bool {
220220
match self.data() {
221221
TyData::Alias(..) => true,
222222
_ => false,
@@ -742,7 +742,7 @@ pub type QuantifiedWhereClause<TF> = Binders<WhereClause<TF>>;
742742
impl<TF: TypeFamily> WhereClause<TF> {
743743
/// Turn a where clause into the WF version of it i.e.:
744744
/// * `Implemented(T: Trait)` maps to `WellFormed(T: Trait)`
745-
/// * `ProjectionEq(<T as Trait>::Item = Foo)` maps to `WellFormed(<T as Trait>::Item = Foo)`
745+
/// * `AliasEq(<T as Trait>::Item = Foo)` maps to `WellFormed(<T as Trait>::Item = Foo)`
746746
/// * any other clause maps to itself
747747
pub fn into_well_formed_goal(self) -> DomainGoal<TF> {
748748
match self {

chalk-ir/src/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ macro_rules! ty {
2323
}).intern()
2424
};
2525

26-
(projection (item $n:tt) $($arg:tt)*) => {
27-
$crate::TyData::Projection(AliasTy {
26+
(alias (item $n:tt) $($arg:tt)*) => {
27+
$crate::TyData::Alias(AliasTy {
2828
associated_ty_id: AssocTypeId(RawId { index: $n }),
2929
substitution: $crate::Substitution::from(vec![$(arg!($arg)),*] as Vec<$crate::Parameter<_>>),
3030
}).intern()

chalk-parse/src/parser.lalrpop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ InlineClause: Clause = {
253253
WhereClause: WhereClause = {
254254
<t:TraitRef<":">> => WhereClause::Implemented { trait_ref: t },
255255

256-
// `T: Foo<U = Bar>` -- projection equality
256+
// `T: Foo<U = Bar>` -- alias equality
257257
<s:Ty> ":" <t:Id> "<" <a:(<Comma<Parameter>> ",")?> <name:Id> <a2:Angle<Parameter>>
258258
"=" <ty:Ty> ">" =>
259259
{

chalk-solve/src/clauses.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ fn program_clauses_that_could_match<TF: TypeFamily>(
181181
// ```
182182
// dyn(exists<T> {
183183
// forall<'a> { Implemented(T: Fn<'a>) },
184-
// forall<'a> { ProjectionEq(<T as Fn<'a>>::Output, ()) },
184+
// forall<'a> { AliasEq(<T as Fn<'a>>::Output, ()) },
185185
// })
186186
// ```
187187
//
@@ -196,7 +196,7 @@ fn program_clauses_that_could_match<TF: TypeFamily>(
196196
// and
197197
//
198198
// ```
199-
// forall<'a> { ProjectionEq(<dyn Fn(&u8) as Fn<'a>>::Output, ()) },
199+
// forall<'a> { AliasEq(<dyn Fn(&u8) as Fn<'a>>::Output, ()) },
200200
// ```
201201
//
202202
// FIXME. This is presently rather wasteful, in that we

chalk-solve/src/clauses/program_clauses.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -510,18 +510,18 @@ impl<TF: TypeFamily> ToProgramClauses<TF> for AssociatedTyDatum<TF> {
510510
/// we generate the 'fallback' rule:
511511
///
512512
/// ```notrust
513-
/// -- Rule ProjectionEq-Placeholder
513+
/// -- Rule AliasEq-Placeholder
514514
/// forall<Self, 'a, T> {
515-
/// ProjectionEq(<Self as Foo>::Assoc<'a, T> = (Foo::Assoc<'a, T>)<Self>).
515+
/// AliasEq(<Self as Foo>::Assoc<'a, T> = (Foo::Assoc<'a, T>)<Self>).
516516
/// }
517517
/// ```
518518
///
519519
/// and
520520
///
521521
/// ```notrust
522-
/// -- Rule ProjectionEq-Normalize
522+
/// -- Rule AliasEq-Normalize
523523
/// forall<Self, 'a, T, U> {
524-
/// ProjectionEq(<T as Foo>::Assoc<'a, T> = U) :-
524+
/// AliasEq(<T as Foo>::Assoc<'a, T> = U) :-
525525
/// Normalize(<T as Foo>::Assoc -> U).
526526
/// }
527527
/// ```
@@ -530,14 +530,14 @@ impl<TF: TypeFamily> ToProgramClauses<TF> for AssociatedTyDatum<TF> {
530530
///
531531
/// ```notrust
532532
/// forall<T> {
533-
/// T: Foo :- exists<U> { ProjectionEq(<T as Foo>::Assoc = U) }.
533+
/// T: Foo :- exists<U> { AliasEq(<T as Foo>::Assoc = U) }.
534534
/// }
535535
/// ```
536536
///
537537
/// but this caused problems with the recursive solver. In
538538
/// particular, whenever normalization is possible, we cannot
539539
/// solve that projection uniquely, since we can now elaborate
540-
/// `ProjectionEq` to fallback *or* normalize it. So instead we
540+
/// `AliasEq` to fallback *or* normalize it. So instead we
541541
/// handle this kind of reasoning through the `FromEnv` predicate.
542542
///
543543
/// We also generate rules specific to WF requirements and implied bounds:
@@ -594,7 +594,7 @@ impl<TF: TypeFamily> ToProgramClauses<TF> for AssociatedTyDatum<TF> {
594594
// and placeholder type.
595595
//
596596
// forall<Self> {
597-
// ProjectionEq(<Self as Foo>::Assoc = (Foo::Assoc)<Self>).
597+
// AliasEq(<Self as Foo>::Assoc = (Foo::Assoc)<Self>).
598598
// }
599599
builder.push_fact(alias_eq);
600600

chalk-solve/src/infer/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fn projection_eq() {
131131
.unify(
132132
&environment0,
133133
&a,
134-
&ty!(apply (item 0) (projection (item 1) (expr a))),
134+
&ty!(apply (item 0) (alias (item 1) (expr a))),
135135
)
136136
.unwrap_err();
137137
}

chalk-solve/src/infer/unify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl<'t, TF: TypeFamily> Unifier<'t, TF> {
215215
/// type `ty` (which might also be a projection). Creates a goal like
216216
///
217217
/// ```notrust
218-
/// ProjectionEq(<T as Trait>::Item = U)
218+
/// AliasEq(<T as Trait>::Item = U)
219219
/// ```
220220
fn unify_alias_ty(&mut self, alias: &AliasTy<TF>, ty: &Ty<TF>) -> Fallible<()> {
221221
Ok(self.goals.push(InEnvironment::new(

0 commit comments

Comments
 (0)