From 545b81aec962ef297b80e9d3812e5d3338c8f919 Mon Sep 17 00:00:00 2001 From: Swann Legras Date: Sun, 5 Jan 2025 11:14:42 +0100 Subject: [PATCH] Relax error bound --- src/lib.rs | 2 +- tests/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 6d58a490..8abbb20d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,7 +53,7 @@ pub trait Logos<'source>: Sized { /// Error type returned by the lexer. This can be set using /// `#[logos(error = MyError)]`. Defaults to `()` if not set. - type Error: Default + Clone + PartialEq + Debug + 'source; + type Error: Default + 'source; /// The heart of Logos. Called by the `Lexer`. The implementation for this function /// is generated by the `logos-derive` crate. diff --git a/tests/src/lib.rs b/tests/src/lib.rs index 76d35308..f44f830d 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -94,6 +94,7 @@ pub fn assert_lex<'a, Token>( ) where Token: Logos<'a> + fmt::Debug + PartialEq, Token::Extras: Default, + Token::Error: fmt::Debug + PartialEq, { let mut lex = Token::lexer(source);