diff options
| -rw-r--r-- | src/parse/regex/bc.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/parse/regex/bc.rs b/src/parse/regex/bc.rs index 90761fd..eec5628 100644 --- a/src/parse/regex/bc.rs +++ b/src/parse/regex/bc.rs @@ -8,12 +8,12 @@ use crate::{ trait Flavor: Clone { type CustomInstr: Copy + Clone; type ThreadData: Clone; - type StepData<'a>; + type StepData<'a, 'b> where 'b : 'a; fn accepts<'a, 'b>( thread: &mut Thread<Self>, instr: Self::CustomInstr, - sd: &mut Self::StepData<'a>, + sd: &mut Self::StepData<'a, 'b>, ) -> bool; } @@ -22,12 +22,12 @@ struct MainFlavor; impl Flavor for MainFlavor { type CustomInstr = MainInstr; type ThreadData = Box<[usize]>; - type StepData<'a> = (usize, &'a BitSet, &'a mut LookaheadVM<'a>); + type StepData<'a, 'b> = (usize, &'a BitSet, &'a mut LookaheadVM<'b>) where 'b : 'a; - fn accepts<'a>( + fn accepts<'a, 'b>( thread: &mut Thread<Self>, instr: Self::CustomInstr, - data: &mut Self::StepData<'a>, + data: &mut Self::StepData<'a, 'b>, ) -> bool { match instr { MainInstr::Save(reg) => { @@ -55,7 +55,7 @@ struct AssertionFlavor; impl Flavor for AssertionFlavor { type CustomInstr = Nothing; type ThreadData = (); - type StepData<'a> = (); + type StepData<'a, 'b> = () where 'b : 'a; fn accepts(_thread: &mut Thread<Self>, instr: Self::CustomInstr, _sd: &mut ()) -> bool { match instr {} @@ -115,7 +115,7 @@ impl<'p, F: Flavor> VM<'p, F> { } } - fn step<'a>(&mut self, byte: u8, sd: &mut F::StepData<'a>) { + fn step<'a>(&mut self, byte: u8, sd: &mut F::StepData<'a, 'p>) { let mut threads: VecDeque<_> = self.threads.drain(..).collect(); self.hot.set_all(false); @@ -203,7 +203,7 @@ struct VirtualMachine<'a> { } impl<'a> VirtualMachine<'a> { - fn step(&'a mut self, byte: u8, loc: usize) { + fn step(&mut self, byte: u8, loc: usize) { self.vm0.step(byte, &mut ()); self.vm1 .step(byte, &mut (loc, &self.vm0.hot, &mut self.vm2)); |
