diff options
| author | Jonas Maier <jonas@x77.dev> | 2026-06-05 15:12:46 +0200 |
|---|---|---|
| committer | Jonas Maier <jonas@x77.dev> | 2026-06-05 15:12:46 +0200 |
| commit | 65013cb7441dcd56d362613e1ebc469756613b24 (patch) | |
| tree | 243974c9fba86d51f893714d7fe88d7b83799ec1 /src | |
| parent | a464bec4d558533776329634504ab0c1bee84bba (diff) | |
| download | pish-65013cb7441dcd56d362613e1ebc469756613b24.tar.gz | |
make it compile
Diffstat (limited to 'src')
| -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)); |
