From a0e1095dd452aa0e52addebb3b9698015718ac4f Mon Sep 17 00:00:00 2001 From: Aron Zwaan Date: Thu, 30 Nov 2023 14:03:26 +0100 Subject: [PATCH] Use boxed iterators for now --- scopegraphs-lib/src/lib.rs | 2 -- scopegraphs-lib/src/scopegraph/completeness.rs | 13 +++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/scopegraphs-lib/src/lib.rs b/scopegraphs-lib/src/lib.rs index c6196cc..528c4d2 100644 --- a/scopegraphs-lib/src/lib.rs +++ b/scopegraphs-lib/src/lib.rs @@ -1,5 +1,3 @@ -#![feature(impl_trait_in_assoc_type)] - pub mod label; pub mod resolve; pub mod scopegraph; diff --git a/scopegraphs-lib/src/scopegraph/completeness.rs b/scopegraphs-lib/src/scopegraph/completeness.rs index 61d1004..ab75a68 100644 --- a/scopegraphs-lib/src/scopegraph/completeness.rs +++ b/scopegraphs-lib/src/scopegraph/completeness.rs @@ -64,7 +64,7 @@ impl Completeness for UncheckedCompleteness inner_scope_graph.add_edge(src, lbl, dst) } - type GetEdgesResult<'a> = impl Iterator + 'a where DATA: 'a, LABEL: 'a; + type GetEdgesResult<'a> = Box + 'a> where DATA: 'a, LABEL: 'a; fn get_edges<'a, 'b: 'a>( &mut self, @@ -72,7 +72,7 @@ impl Completeness for UncheckedCompleteness src: Scope, lbl: &'b LABEL, ) -> Self::GetEdgesResult<'a> { - inner_scope_graph.get_edges(src, lbl) + Box::new(inner_scope_graph.get_edges(src, lbl)) } } @@ -143,7 +143,8 @@ impl Label<'a>, DATA> Completeness } } - type GetEdgesResult<'a> = EdgesOrDelay<'a, impl Iterator, LABEL> where DATA: 'a, LABEL: 'a; + + type GetEdgesResult<'a> = EdgesOrDelay<'a, Box + 'a>, LABEL> where DATA: 'a, LABEL: 'a; fn get_edges<'a, 'b: 'a>( &mut self, @@ -158,7 +159,7 @@ impl Label<'a>, DATA> Completeness } } else { EdgesOrDelay::Edges { - edges: inner_scope_graph.get_edges(src, lbl), + edges: Box::new(inner_scope_graph.get_edges(src, lbl)), } } } @@ -202,7 +203,7 @@ impl Label<'a>, DATA> Completeness } } - type GetEdgesResult<'a> = impl Iterator where DATA: 'a, LABEL: 'a; + type GetEdgesResult<'a> = Box + 'a> where DATA: 'a, LABEL: 'a; fn get_edges<'a, 'b: 'a>( &mut self, @@ -211,7 +212,7 @@ impl Label<'a>, DATA> Completeness lbl: &'b LABEL, ) -> Self::GetEdgesResult<'a> { self.critical_edges.close(src, &lbl); - inner_scope_graph.get_edges(src, lbl) + Box::new(inner_scope_graph.get_edges(src, lbl)) } }