Skip to content

Commit 049f4d9

Browse files
committed
Fix the spinach GATs build
Broken due to rust-lang/rust#89970
1 parent acc12cd commit 049f4d9

File tree

5 files changed

+35
-16
lines changed

5 files changed

+35
-16
lines changed

spinachflow/src/collections.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ pub trait Collection<K, V> {
2727

2828
type Keys<'s>: Iterator<Item = &'s K>
2929
where
30-
K: 's;
30+
K: 's,
31+
Self: 's;
3132
fn keys(&self) -> Self::Keys<'_>;
3233

3334
type Entries<'s>: Iterator<Item = (&'s K, &'s V)>
3435
where
3536
K: 's,
36-
V: 's;
37+
V: 's,
38+
Self: 's;
3739
fn entries(&self) -> Self::Entries<'_>;
3840
}
3941

spinachflow/src/comp/comptrait.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ impl<'s, C: Comp + ?Sized> Future for CompRunFuture<'s, C> {
2828
pub trait Comp {
2929
type Error: std::fmt::Debug;
3030

31-
type TickFuture<'s>: Future<Output = Result<(), Self::Error>>;
31+
type TickFuture<'s>: Future<Output = Result<(), Self::Error>>
32+
where
33+
Self: 's;
3234
fn tick(&self) -> Self::TickFuture<'_>;
3335
}
3436

spinachflow/src/comp/debugcomp.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,28 @@ use crate::op::OpDelta;
66

77
use super::{Comp, Next};
88

9-
pub struct DebugComp<O: OpDelta>
9+
pub struct DebugComp<O>
1010
where
11+
O: 'static + OpDelta,
1112
<O::LatRepr as LatticeRepr>::Repr: Debug,
1213
{
1314
op: O,
1415
tag: &'static str,
1516
}
1617

17-
impl<O: OpDelta> DebugComp<O>
18+
impl<O> DebugComp<O>
1819
where
20+
O: 'static + OpDelta,
1921
<O::LatRepr as LatticeRepr>::Repr: Debug,
2022
{
2123
pub fn new(op: O, tag: &'static str) -> Self {
2224
Self { op, tag }
2325
}
2426
}
2527

26-
impl<O: OpDelta> Comp for DebugComp<O>
28+
impl<O> Comp for DebugComp<O>
2729
where
30+
O: 'static + OpDelta,
2831
<O::LatRepr as LatticeRepr>::Repr: Debug,
2932
{
3033
type Error = ();

spinachflow/src/comp/dynsplitcomp.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ use super::{Comp, CompConnector, Next};
1212

1313
pub struct DynSplitComp<O: OpValue + OpDelta, P, C>
1414
where
15-
P: OpDelta,
15+
O: 'static + OpValue + OpDelta,
16+
P: 'static + OpDelta,
1617
P::LatRepr: LatticeRepr<Lattice = SetUnion<C>>,
1718
<P::LatRepr as LatticeRepr>::Repr: IntoIterator<Item = C>,
18-
C: CompConnector<SplitOp<O>>,
19+
C: 'static + CompConnector<SplitOp<O>>,
1920
{
2021
splitter: Splitter<O>,
2122
pipe_op: P,
@@ -25,10 +26,11 @@ where
2526

2627
impl<O: OpValue + OpDelta, P, C> DynSplitComp<O, P, C>
2728
where
28-
P: OpDelta,
29+
O: 'static + OpValue + OpDelta,
30+
P: 'static + OpDelta,
2931
P::LatRepr: LatticeRepr<Lattice = SetUnion<C>>,
3032
<P::LatRepr as LatticeRepr>::Repr: IntoIterator<Item = C>,
31-
C: CompConnector<SplitOp<O>>,
33+
C: 'static + CompConnector<SplitOp<O>>,
3234
{
3335
pub fn new(splitter: Splitter<O>, pipe_op: P) -> Self {
3436
Self {
@@ -40,12 +42,13 @@ where
4042
}
4143
}
4244

43-
impl<O: OpValue + OpDelta, P, C> Comp for DynSplitComp<O, P, C>
45+
impl<O, P, C> Comp for DynSplitComp<O, P, C>
4446
where
45-
P: OpDelta,
47+
O: 'static + OpValue + OpDelta,
48+
P: 'static + OpDelta,
4649
P::LatRepr: LatticeRepr<Lattice = SetUnion<C>>,
4750
<P::LatRepr as LatticeRepr>::Repr: IntoIterator<Item = C>,
48-
C: CompConnector<SplitOp<O>>,
51+
C: 'static + CompConnector<SplitOp<O>>,
4952
{
5053
type Error = <C::Comp as Comp>::Error;
5154

spinachflow/src/comp/nullcomp.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ use crate::op::OpDelta;
44

55
use super::{Comp, Next};
66

7-
pub struct NullComp<O: OpDelta> {
7+
pub struct NullComp<O>
8+
where
9+
O: 'static + OpDelta,
10+
{
811
op: O,
912
}
1013

11-
impl<O: OpDelta> NullComp<O> {
14+
impl<O> NullComp<O>
15+
where
16+
O: 'static + OpDelta,
17+
{
1218
pub fn new(op: O) -> Self {
1319
Self { op }
1420
}
1521
}
1622

17-
impl<O: OpDelta> Comp for NullComp<O> {
23+
impl<O> Comp for NullComp<O>
24+
where
25+
O: 'static + OpDelta,
26+
{
1827
type Error = ();
1928

2029
type TickFuture<'s> = impl Future<Output = Result<(), Self::Error>>;

0 commit comments

Comments
 (0)