From 7ebc5ba6150dcdd0087812d1d25dd3746ae40f9e Mon Sep 17 00:00:00 2001 From: timofey Date: Sat, 29 Jul 2023 08:20:54 +0000 Subject: [PATCH] loosen `Origin` bounds --- src/rcore/origin.rs | 2 +- src/rstd/wrapped_origin.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rcore/origin.rs b/src/rcore/origin.rs index 4dd8a1f..7d343cc 100644 --- a/src/rcore/origin.rs +++ b/src/rcore/origin.rs @@ -3,7 +3,7 @@ use super::*; /// Represents a potentially resolvable [`Mentionable`]. pub trait Origin<'a, Ctx: Context<'a>>: 'a { /// Type of the associated object. - type Mtbl: Mentionable<'a, Ctx>; + type Mtbl: MentionableBase<'a, Ctx>; /// Clone the associated factory. fn factory(&self) -> OFctr<'a, Ctx, Self>; /// Try resolving the value. diff --git a/src/rstd/wrapped_origin.rs b/src/rstd/wrapped_origin.rs index 8eb5fdf..5f7ac83 100644 --- a/src/rstd/wrapped_origin.rs +++ b/src/rstd/wrapped_origin.rs @@ -24,7 +24,10 @@ pub trait MappableOrigin<'a, Ctx: Context<'a>>: Origin<'a, Ctx> { + Clone + Fn(ParseError<'a, Ctx, OFctr<'a, Ctx, Self>>) -> ParseError<'a, Ctx, B::Fctr>, map_factory: impl 'a + FnOnce(OFctr<'a, Ctx, Self>) -> B::Fctr, - ) -> Rc> { + ) -> Rc> + where + OFctr<'a, Ctx, Self>: Factory<'a, Ctx>, + { let origin_r = self.clone(); let origin_rb = self.clone(); let origin: WrappedOrigin<'a, Ctx, B> = WrappedOrigin {