From 9f62a1a155818f6ff54c8ae78937eb3ffd5851ea Mon Sep 17 00:00:00 2001 From: matt rice Date: Mon, 30 Sep 2024 06:13:52 -0700 Subject: [PATCH] Relax `%parse-param` bounds from `Copy` to `Clone` --- lrpar/src/lib/cpctplus.rs | 14 +++++++------- lrpar/src/lib/parser.rs | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lrpar/src/lib/cpctplus.rs b/lrpar/src/lib/cpctplus.rs index 86dc1e1ba..0ee626e8a 100644 --- a/lrpar/src/lib/cpctplus.rs +++ b/lrpar/src/lib/cpctplus.rs @@ -106,7 +106,7 @@ struct CPCTPlus< StorageT: 'static + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, > where usize: AsPrimitive, { @@ -118,7 +118,7 @@ pub(super) fn recoverer< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, >( parser: &'a Parser, ) -> Box + 'a> @@ -135,7 +135,7 @@ impl< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, > Recoverer for CPCTPlus<'a, 'b, 'input, StorageT, LexerTypesT, ActionT, ParamT> where @@ -270,7 +270,7 @@ impl< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, > CPCTPlus<'a, 'b, 'input, StorageT, LexerTypesT, ActionT, ParamT> where usize: AsPrimitive, @@ -457,7 +457,7 @@ fn apply_repairs< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, >( parser: &Parser, mut laidx: usize, @@ -496,7 +496,7 @@ fn simplify_repairs< StorageT: 'static + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT, - ParamT: Copy, + ParamT: Clone, >( parser: &Parser, all_rprs: &mut Vec>>, @@ -557,7 +557,7 @@ fn rank_cnds< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, >( parser: &Parser, finish_by: Instant, diff --git a/lrpar/src/lib/parser.rs b/lrpar/src/lib/parser.rs index 5f38e2070..7252b48be 100644 --- a/lrpar/src/lib/parser.rs +++ b/lrpar/src/lib/parser.rs @@ -88,7 +88,7 @@ pub(super) struct Parser< StorageT: 'static + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, > where usize: AsPrimitive, { @@ -241,7 +241,7 @@ impl< StorageT: 'static + Debug + Eq + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT: 'a, - ParamT: Copy, + ParamT: Clone, > Parser<'a, 'b, 'input, StorageT, LexerTypesT, ActionT, ParamT> where usize: AsPrimitive, @@ -329,7 +329,7 @@ where self.lexer, span, astack.drain(pop_idx - 1..), - self.param, + self.param.clone(), )); astack.push(v); } @@ -447,7 +447,7 @@ where self.lexer, span, astack_uw.drain(pop_idx - 1..), - self.param, + self.param.clone(), )); astack_uw.push(v); } else { @@ -595,7 +595,7 @@ pub(super) trait Recoverer< StorageT: 'static + Debug + Hash + PrimInt + Unsigned, LexerTypesT: LexerTypes, ActionT, - ParamT: Copy, + ParamT: Clone, > where usize: AsPrimitive, {