Closed
Description
playground, r/rust thread (includes larger examples)
use std::marker::PhantomData;
pub trait FromPest<'a>: Sized {
type Rule;
const RULE: Self::Rule;
}
impl<'a, T> FromPest<'a> for PhantomData<T>
where
T: FromPest<'a>,
{
type Rule = T::Rule;
const RULE: T::Rule = T::RULE;
}
error[E0277]: the trait bound `T: FromPest<'a>` is not satisfied
--> src/lib.rs:13:5
|
13 | const RULE: T::Rule = T::RULE;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `FromPest<'a>` is not implemented for `T`
|
= help: consider adding a `where T: FromPest<'a>` bound
I'm unsure as to whether this is a compiler bug or something I've missed, but at the very least, this error is less than helpful at exposing the actual issue.
Metadata
Metadata
Assignees
Labels
No labels