From 0c760bf570f8cbc3f09730744ded3ed507a22a86 Mon Sep 17 00:00:00 2001 From: Kevin Phoenix Date: Tue, 12 Nov 2024 14:39:41 -0700 Subject: [PATCH] Fix lifetime errors --- crates/clarirs_core/src/algorithms/simplify.rs | 10 +++++----- crates/clarirs_core/src/context.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/clarirs_core/src/algorithms/simplify.rs b/crates/clarirs_core/src/algorithms/simplify.rs index 830d026..78a1f10 100644 --- a/crates/clarirs_core/src/algorithms/simplify.rs +++ b/crates/clarirs_core/src/algorithms/simplify.rs @@ -17,11 +17,11 @@ macro_rules! simplify { } pub trait Simplify<'c>: Sized { - fn simplify(&'c self) -> Result; + fn simplify(&self) -> Result; } impl<'c> Simplify<'c> for BoolAst<'c> { - fn simplify(&'c self) -> Result { + fn simplify(&self) -> Result { let ctx = self.context(); self.context() @@ -288,7 +288,7 @@ impl<'c> Simplify<'c> for BoolAst<'c> { } impl<'c> Simplify<'c> for BitVecAst<'c> { - fn simplify(&'c self) -> Result { + fn simplify(&self) -> Result { let ctx = self.context(); self.context() @@ -823,7 +823,7 @@ impl<'c> Simplify<'c> for BitVecAst<'c> { } impl<'c> Simplify<'c> for FloatAst<'c> { - fn simplify(&'c self) -> Result { + fn simplify(&self) -> Result { let ctx = self.context(); self.context() @@ -950,7 +950,7 @@ impl<'c> Simplify<'c> for FloatAst<'c> { } impl<'c> Simplify<'c> for StringAst<'c> { - fn simplify(&'c self) -> Result { + fn simplify(&self) -> Result { let ctx = self.context(); self.context() diff --git a/crates/clarirs_core/src/context.rs b/crates/clarirs_core/src/context.rs index 75bc0ae..e44679f 100644 --- a/crates/clarirs_core/src/context.rs +++ b/crates/clarirs_core/src/context.rs @@ -73,14 +73,14 @@ impl<'c> AstFactory<'c> for Context<'c> { } pub trait HasContext<'c> { - fn context(&self) -> &Context<'c>; + fn context(&self) -> &'c Context<'c>; } impl<'c, T> HasContext<'c> for Arc where T: HasContext<'c>, { - fn context(&self) -> &Context<'c> { + fn context(&self) -> &'c Context<'c> { self.as_ref().context() } }