Skip to content

Commit 225665f

Browse files
committed
Allow omitting empty for<> before fn
1 parent 69ef3a0 commit 225665f

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

chalk-parse/src/parser.lalrpop

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ pub Ty: Ty = {
174174

175175
TyWithoutFor: Ty = {
176176
<n:Id> => Ty::Id { name: n},
177+
"fn" "(" <t:Ty> ")" => Ty::ForAll {
178+
lifetime_names: vec![],
179+
ty: Box::new(t)
180+
},
177181
"dyn" <b:Plus<QuantifiedInlineBound>> => Ty::Dyn {
178182
bounds: b,
179183
},

tests/test/projection.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ fn forall_projection() {
357357
}
358358

359359
goal {
360-
for<'a> fn(<Unit as DropLt<'a>>::Item): Eq<for<> fn(Unit)>
360+
for<'a> fn(<Unit as DropLt<'a>>::Item): Eq<fn(Unit)>
361361
} yields {
362362
"Unique; substitution [], lifetime constraints []"
363363
}
@@ -384,7 +384,7 @@ fn forall_projection_gat() {
384384

385385
goal {
386386
forall<T> {
387-
for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<for<> fn(Unit)>
387+
for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<fn(Unit)>
388388
}
389389
} yields {
390390
"No possible solution"
@@ -393,7 +393,7 @@ fn forall_projection_gat() {
393393
goal {
394394
forall<T> {
395395
if (T: Sized) {
396-
for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<for<> fn(Unit)>
396+
for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<fn(Unit)>
397397
}
398398
}
399399
} yields {
@@ -411,7 +411,7 @@ fn forall_projection_gat() {
411411
goal {
412412
forall<T> {
413413
if (T: Sized) {
414-
WellFormed(for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<for<> fn(Unit)>)
414+
WellFormed(for<'a> fn(<Unit as DropOuter<'a>>::Item<T>): Eq<fn(Unit)>)
415415
}
416416
}
417417
} yields {

tests/test/unify.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ fn equality_binder() {
130130
goal {
131131
forall<T> {
132132
exists<'a> {
133-
for<'c> fn(Ref<'c, T>) = for<> fn(Ref<'a, T>)
133+
for<'c> fn(Ref<'c, T>) = fn(Ref<'a, T>)
134134
}
135135
}
136136
} yields {
@@ -293,7 +293,7 @@ fn quantified_types() {
293293
}
294294

295295
goal {
296-
forall<'a> { for<> fn(fn1<'a>): Foo }
296+
forall<'a> { fn(fn1<'a>): Foo }
297297
} yields {
298298
// Lifetime constraints are unsatisfiable
299299
"Unique; substitution [], \

0 commit comments

Comments
 (0)