loosen Origin bounds

This commit is contained in:
AF 2023-07-29 08:20:54 +00:00
parent c0e7e54e34
commit 7ebc5ba615
2 changed files with 5 additions and 2 deletions

View File

@ -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.

View File

@ -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<dyn Origin<'a, Ctx, Mtbl = B>> {
) -> Rc<dyn Origin<'a, Ctx, Mtbl = B>>
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 {