chumsky
chumsky copied to clipboard
make `Rich` compare spans instead of all members for `Eq`
from the current code:
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct Rich<'a, T, S = SimpleSpan<usize>> {
span: S,
reason: Box<RichReason<'a, T>>,
context: Vec<(RichPattern<'a, T>, S)>,
}
this is annoying because T might not always implement Eq and PartialEq
for example proc_macro2::TokenTree doesn't
actually there is another problem: LabelError needs PartialEq on tokens too...
Is there something specific you need PartialEq for?
Is there something specific you need
PartialEqfor?
No, but LabelError needs PartialEq on tokens
I am happy to accept a PR for this change!