Skip to content

Commit de27110

Browse files
authored
Updates the GAT syntax (#7)
Signed-off-by: Arjo Chakravarty <[email protected]>
1 parent f241333 commit de27110

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

mapf/src/directed/simple.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<V: std::fmt::Debug + Clone> crate::Graph for SimpleGraph<V> {
8181
type Vertex = V;
8282
type Edge = (usize, usize);
8383

84-
type EdgeIter<'a> where Self: 'a = impl Iterator<Item=(usize, usize)> + 'a;
84+
type EdgeIter<'a> = impl Iterator<Item=(usize, usize)> + 'a where Self: 'a;
8585

8686
fn vertex (&self, key: usize) -> Option<V> {
8787
self.vertices.get(key).cloned()

mapf/src/expander/chain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl<E: Expander, C: Expander<Node=E::Node>> Expander for Chain<E, C> {
4343

4444
impl<E: Targeted<G>, C: Targeted<G, Node=E::Node>, G: Goal<E::Node>> Targeted<G> for Chain<E, C> {
4545
type TargetedError = ChainErr<E::TargetedError, C::TargetedError>;
46-
type TargetedExpansion<'a> where Self: 'a, G: 'a = impl Iterator<Item=Result<Arc<Self::Node>, Self::TargetedError>> + 'a;
46+
type TargetedExpansion<'a> = impl Iterator<Item=Result<Arc<Self::Node>, Self::TargetedError>> + 'a where Self: 'a, G: 'a;
4747

4848
fn expand<'a>(
4949
&'a self,
@@ -62,7 +62,7 @@ where
6262
G: Goal<E::Node>,
6363
{
6464
type InitTargetedError = E::InitTargetedError;
65-
type InitialTargetedNodes<'a> where Self: 'a, S: 'a, G: 'a = E::InitialTargetedNodes<'a>;
65+
type InitialTargetedNodes<'a> = E::InitialTargetedNodes<'a> where Self: 'a, S: 'a, G: 'a;
6666

6767
fn start<'a>(
6868
&'a self,

mapf/src/expander/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ where
5959
F: Fn(&Arc<N>, &G) -> Exp
6060
{
6161
type TargetedError = Err;
62-
type TargetedExpansion<'a> where Self: 'a = Exp;
62+
type TargetedExpansion<'a> = Exp where Self: 'a;
6363

6464
fn expand<'a>(
6565
&'a self,

mapf/src/expander/constrain.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<E: Expander, C> Expander for Constrain<E, C> {
5757

5858
impl<E: Targeted<G>, C: TargetedConstraint<E::Node, G>, G: Goal<E::Node>> Targeted<G> for Constrain<E, C> {
5959
type TargetedError = ConstrainErr<E::TargetedError, C::ConstraintError>;
60-
type TargetedExpansion<'a> where Self: 'a, G: 'a = impl Iterator<Item=Result<Arc<Self::Node>, Self::TargetedError>> + 'a;
60+
type TargetedExpansion<'a> = impl Iterator<Item=Result<Arc<Self::Node>, Self::TargetedError>> + 'a where Self: 'a, G: 'a ;
6161

6262
fn expand<'a>(
6363
&'a self,
@@ -77,7 +77,7 @@ where
7777
G: Goal<E::Node>,
7878
{
7979
type InitTargetedError = ConstrainErr<E::InitTargetedError, C::ConstraintError>;
80-
type InitialTargetedNodes<'a> where Self: 'a, S: 'a, G: 'a = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitTargetedError>> + 'a;
80+
type InitialTargetedNodes<'a> = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitTargetedError>> + 'a where Self: 'a, S: 'a, G: 'a;
8181

8282
fn start<'a>(
8383
&'a self,

mapf/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*
1616
*/
17-
#![feature(generic_associated_types, associated_type_bounds, type_alias_impl_trait)]
17+
#![feature(associated_type_bounds, type_alias_impl_trait)]
1818

1919
pub mod progress;
2020

mapf/src/motion/graph_search.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ where
291291
P::Reach: Reachable<P::Node, G, P::Waypoint>,
292292
{
293293
type TargetedError = ExpansionErrorOf<P, G>;
294-
type TargetedExpansion<'a> where P: 'a, G: 'a = impl Iterator<Item=Result<Arc<P::Node>, ExpansionErrorOf<P, G>>> + 'a;
294+
type TargetedExpansion<'a> = impl Iterator<Item=Result<Arc<P::Node>, ExpansionErrorOf<P, G>>> + 'a where P: 'a, G: 'a ;
295295

296296
fn expand<'a>(
297297
&'a self,
@@ -338,7 +338,7 @@ where
338338

339339
impl<P: Policy> Aimless for Expander<P> {
340340
type AimlessError = ExtrapolatorErrorOf<P>;
341-
type AimlessExpansion<'a> where P: 'a = impl Iterator<Item=Result<Arc<P::Node>, Self::AimlessError>> + 'a;
341+
type AimlessExpansion<'a> = impl Iterator<Item=Result<Arc<P::Node>, Self::AimlessError>> + 'a where P: 'a;
342342

343343
fn aimless_expand<'a>(
344344
&'a self,

mapf/src/motion/hold.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<W: Waypoint, C: CostCalculator<W>, N> Expander for Hold<W, C, N> {
6060

6161
impl<W: Waypoint, C: CostCalculator<W, Cost=N::Cost>, N: Informed + Movable<W>, G: Goal<N>> Targeted<G> for Hold<W, C, N> {
6262
type TargetedError = NoError;
63-
type TargetedExpansion<'a> where W: 'a, N: 'a, C: 'a, G: 'a = impl Iterator<Item=Result<Arc<N>, NoError>>;
63+
type TargetedExpansion<'a> = impl Iterator<Item=Result<Arc<N>, NoError>> where W: 'a, N: 'a, C: 'a, G: 'a ;
6464

6565
fn expand<'a>(
6666
&'a self,

mapf/src/motion/r2/graph_search.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ where
105105
H: Heuristic<G::Key, G::Key, C::Cost>,
106106
{
107107
type InitAimlessError = InitErrorR2<G::Key, H::Error>;
108-
type InitialAimlessNodes<'a> where G: 'a, C: 'a, H: 'a, S: 'a = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitAimlessError>>;
108+
type InitialAimlessNodes<'a> = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitAimlessError>> + 'a where G: 'a, C: 'a, H: 'a, S: 'a;
109109

110110
fn aimless_start<'a>(
111111
&'a self,
@@ -141,7 +141,7 @@ where
141141
H: Heuristic<G::Key, G::Key, C::Cost>,
142142
{
143143
type InitTargetedError = InitErrorR2<G::Key, H::Error>;
144-
type InitialTargetedNodes<'a> where G: 'a, C: 'a, H: 'a, S: 'a = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitTargetedError>>;
144+
type InitialTargetedNodes<'a> = impl Iterator<Item=Result<Arc<Self::Node>, Self::InitTargetedError>> + 'a where G: 'a, C: 'a, H: 'a, S: 'a ;
145145

146146
fn start<'a>(
147147
&'a self,

mapf/src/motion/reach.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub trait Reachable<Node, Goal, W: Waypoint> {
3535
pub struct NoReach;
3636
impl<N, G, W: Waypoint> Reachable<N, G, W> for NoReach {
3737
type ReachError = NoError;
38-
type Reaching<'a> where N: 'a, G: 'a, W: 'a = impl Iterator<Item=Result<Trajectory<W>, NoError>>;
38+
type Reaching<'a> = impl Iterator<Item=Result<Trajectory<W>, NoError>> where N: 'a, G: 'a, W: 'a ;
3939

4040
fn reach_for<'a>(&'a self, _: &'a N, _: &'a G) -> Self::Reaching<'a> {
4141
[].into_iter()

mapf/src/motion/se2/graph_search.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ pub struct ReachForLinearSE2 {
127127

128128
impl<GraphKey: Key, const RESOLUTION: u64> Reachable<Node<GraphKey, RESOLUTION>, GoalSE2<GraphKey>, se2::timed_position::Waypoint> for ReachForLinearSE2 {
129129
type ReachError = NoError;
130-
type Reaching<'a> = impl Iterator<Item=Result<se2::LinearTrajectory, NoError>>;
130+
type Reaching<'a> = impl Iterator<Item=Result<se2::LinearTrajectory, NoError>> + 'a;
131131

132132
fn reach_for<'a>(&'a self, parent: &'a Node<GraphKey, RESOLUTION>, goal: &'a GoalSE2<GraphKey>) -> Self::Reaching<'a> {
133133
[parent].into_iter()
@@ -298,7 +298,7 @@ where
298298
H: Heuristic<KeySE2<G::Key, RESOLUTION>, GoalSE2<G::Key>, i64>,
299299
{
300300
type InitTargetedError = InitErrorSE2<H::Error>;
301-
type InitialTargetedNodes<'a> where G: 'a, C: 'a, H: 'a, S: 'a = impl Iterator<Item=Result<Arc<Node<G::Key, RESOLUTION>>, Self::InitTargetedError>> + 'a;
301+
type InitialTargetedNodes<'a> = impl Iterator<Item=Result<Arc<Node<G::Key, RESOLUTION>>, Self::InitTargetedError>> + 'a where G: 'a, C: 'a, H: 'a, S: 'a;
302302

303303
fn start<'a>(
304304
&'a self,

mapf/src/node/closed_set.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl<N: Weighted + PartialKeyed> Default for PartialKeyedClosedSet<N> {
102102
}
103103

104104
impl<N: Weighted + PartialKeyed> ClosedSet<N> for PartialKeyedClosedSet<N> {
105-
type Iter<'a> where N: 'a = impl Iterator<Item=&'a Arc<N>> + 'a;
105+
type Iter<'a> = impl Iterator<Item=&'a Arc<N>> + 'a where N: 'a;
106106

107107
fn close(&mut self, node: &Arc<N>) -> CloseResult<N> {
108108
if let Some(key) = node.partial_key() {
@@ -169,7 +169,7 @@ impl<N: Weighted + PartialKeyed + Timed> Default for TimeVariantPartialKeyedClos
169169
}
170170

171171
impl<N: Weighted + PartialKeyed + Timed> ClosedSet<N> for TimeVariantPartialKeyedClosetSet<N> {
172-
type Iter<'a> where N: 'a = impl Iterator<Item=&'a Arc<N>> + 'a;
172+
type Iter<'a> = impl Iterator<Item=&'a Arc<N>> + 'a where N: 'a ;
173173

174174
fn close(&mut self, node: &Arc<N>) -> CloseResult<N> {
175175
if let Some(key) = node.partial_key() {

mapf/src/occupancy/graph.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<G: Grid> Graph for VisibilityGraph<G> {
8686
type Key = Cell;
8787
type Vertex = Point;
8888
type Edge = (Cell, Cell);
89-
type EdgeIter<'a> where Self: 'a = impl Iterator<Item=(Cell, Cell)> + 'a;
89+
type EdgeIter<'a> = impl Iterator<Item=(Cell, Cell)> + 'a where Self: 'a;
9090

9191
fn vertex(&self, cell: Self::Key) -> Option<Self::Vertex> {
9292
// We don't bother to filter out occupied cells because those cells will
@@ -162,7 +162,7 @@ impl<G: Grid> Graph for NeighborhoodGraph<G> {
162162
type Key = Cell;
163163
type Vertex = Point;
164164
type Edge = (Cell, Cell);
165-
type EdgeIter<'a> where Self: 'a = impl Iterator<Item=(Cell, Cell)> + 'a;
165+
type EdgeIter<'a> = impl Iterator<Item=(Cell, Cell)> + 'a where Self: 'a;
166166

167167
fn vertex(&self, cell: Self::Key) -> Option<Self::Vertex> {
168168
if self.visibility.grid().is_occupied(&cell) {

0 commit comments

Comments
 (0)